Skip to main content

Identifier

Generate identifier values.

ulid

ULID values.

Signatures:

  • fc.ulid()

Usages:

fc.ulid();
// Examples of generated values:
// • "7AVDFZJAXCM0F25E3SZZZZZZYZ"
// • "7ZZZZZZZYP5XN60H51ZZZZZZZP"
// • "2VXXEMQ2HWRSNWMP9PZZZZZZZA"
// • "15RQ23H1M8YB80EVPD2EG8W7K1"
// • "6QV4RKC7C8ZZZZZZZFSF7PWQF5"
// • …

Resources: API reference.
Available since 3.11.0.

uuid

UUID values including versions 1 to 5 and going up to 15 when asked to.

Signatures:

  • fc.uuid()
  • fc.uuid({version?})

with:

  • version — default: [1,2,3,4,5]version or versions of the uuid to produce: 1, 2, 3, 4, 5... or 15

Usages:

fc.uuid();
// Examples of generated values:
// • "4ebb3995-0009-1000-8b20-2254b7902e27"
// • "ffffffef-50fb-40b5-aa9f-05640000001d"
// • "87a8e397-ffec-5fff-8000-001a00000004"
// • "17983d5d-001b-1000-98d3-6afba08e1e61"
// • "7da15579-001d-1000-a6b3-4d71cf6e5de5"
// • …

fc.uuid({ version: 4 });
// Examples of generated values:
// • "00000009-2401-464f-bd6c-b85100000018"
// • "ffffffea-ffe7-4fff-af56-be4ec6ccfa3c"
// • "00000013-6705-4bdd-bfe3-0669d6ee4e9a"
// • "ed7479b3-cef8-4562-bc9c-0b0d8b2be3ae"
// • "58dbd17a-7152-4770-8d89-9485fffffff6"
// • …

fc.uuid({ version: [4, 7] });
// Examples of generated values:
// • "ffffffe8-4e61-40c1-8000-001d7f621812"
// • "0000001f-b6dc-7d7d-b40c-08568ae90153"
// • "0000000b-0002-4000-9003-de96d8957794"
// • "8b8e8b89-251e-78e7-8000-000000000000"
// • "ffffffe5-000d-4000-bfff-fff496517cc4"
// • …

Resources: API reference.
Available since 1.17.0.

uuidV

UUID values for a specific UUID version (only 1 to 15) only digits in 0-9a-f.

Signatures:

  • fc.uuidV(version)deprecated since v3.21.0 (#5103)

with:

  • versionversion of the uuid to produce: 1, 2, 3, 4, 5... or 15

Usages:

fc.uuidV(3);
// Examples of generated values:
// • "d9951cc0-000f-3000-886d-743b90c0903c"
// • "b4f42187-7bd2-3385-8000-000794a930da"
// • "c2faeae2-2bd2-31a4-81e8-3f5800000007"
// • "65c2d0a5-0004-3000-8000-000e579a5fa4"
// • "00000002-0008-3000-8000-000b1bc90950"
// • …

fc.uuidV(5);
// Examples of generated values:
// • "40884311-1487-57f0-bfff-ffe30000000c"
// • "ffffffea-0019-5000-99e6-b63700000007"
// • "f92ab3fe-000f-5000-abf4-8b9a04f4449f"
// • "b77d67e3-001a-5000-8e94-de76050b8105"
// • "00000014-000e-5000-8caa-1615aee2e3cd"
// • …

Resources: API reference.
Available since 1.17.0.