跳到主要内容
Z

What is UUID?

A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit identifier written as 32 hexadecimal digits in five groups (8-4-4-4-12). UUIDs are generated to be unique across space and time without a central authority, so different systems can create IDs that practically never collide.

A UUID looks like 550e8400-e29b-41d4-a716-446655440000. The most common is version 4, which is random; other versions derive from time, namespace or a hash. With 122 random bits, accidental collisions are astronomically unlikely.

UUIDs are used as database primary keys, distributed-system identifiers and idempotency keys — anywhere you need a unique ID without coordinating with a central counter.

UUID tools

常见问题

我可以使用哪些 dot-path?

任何位于 <code class="font-mono text-xs">faker.*</code> 下的路径都可以——例如 <code class="font-mono text-xs">person.firstName</code>、<code class="font-mono text-xs">company.name</code>、<code class="font-mono text-xs">finance.iban</code>、<code class="font-mono text-xs">date.past</code>。完整列表请参阅 faker.js 官方文档。

可以传入参数吗?

可以——在括号中放入参数对象即可。例如:<code class="font-mono text-xs">number.int({min:1,max:100})</code> 或 <code class="font-mono text-xs">helpers.arrayElement(["a","b","c"])</code>。

这些数据来自哪里?

一切都在你的浏览器中运行——faker.js 在本地生成数据,不会发起任何 API 调用。你的 schema 和数据永远不会离开你的设备。