种子固定:相同的 schema、行数与种子始终生成相同的输出。行内数据连贯——邮箱与姓名匹配;城市、州、邮编、电话与货币与国家匹配。
功能说明
根据 schema 和种子生成确定性的假数据。可从八个类别共 43 种字段类型中选择:身份(name、email、username)、联系方式(phone、avatar、password)、地理位置(country、city、state、postal、street、coordinates)、商业(company、job title、price、currency、product name、SKU)、网络(URL、slug、IPv4/IPv6、MAC、color、user agent)、文本(word、sentence、paragraph、headline、catchphrase)和数值(integer、number、decimal、percentage、sequence、boolean),外加
UUIDUUIDA 128-bit identifier generated to be practically unique without coordination, most commonly in version-4 (fully random) form.
、date、pick-from-list、string 和 index。各行数据是连贯的:email 与同一行的 name 匹配,city、state、postal code、电话格式和 currency 都与该行的 country 匹配。基于种子生成,因此相同的 schema、行数和种子总是产生完全相同的输出 - 非常适合用作 fixture 和测试数据。100% 客户端运行。使用方法
- 添加字段:为每个字段指定一个名称,并从分组列表(身份、联系方式、地理位置、商业、网络、文本、数值、其他)中选择类型。
- 设置随后出现的类型专属选项(min/max、precision、length、charset、start/step 或选项列表)。
- 设置行数(1-500)和种子 - 点击 New seed 换一批不同的随机结果。
- JSON 在右侧实时渲染,滚动 schema 时保持固定。
- 复制结果,或将其下载为
mock-data.json。
示例
schema 为 id: index, name: fullName, email: email、3 行、种子 1 → 得到一个 3 元素数组,id 依次递增,name 和 email 相互对应(每个 email 都由所在行的 name 派生)。
schema 为 country, city, postal, phone、5 行 → 每一行的 city、postal 格式和电话格式都与该行的 country 匹配。
补充说明
- 私密: 生成完全在本地进行;数据是合成的,不涉及真实人物。
- 基于种子的确定性生成(mulberry32 PRNG)- 不是密码学安全随机;
UUIDUUIDA 128-bit identifier generated to be practically unique without coordination, most commonly in version-4 (fully random) form.
为 v4 形态。 - 头像是内联生成的 SVG identicon - 不发起任何外部请求。
- 相关工具:
UUIDUUIDA 128-bit identifier generated to be practically unique without coordination, most commonly in version-4 (fully random) form.
Generator、JSON to TypeScript。