{"version":3,"file":"_randomFormatUuid.mjs","names":[],"sources":["../../src/internal/_randomFormatUuid.ts"],"sourcesContent":["import { _ILengthProps, _randomFormatLength } from \"./_randomStringLength\";\n\n/**\n * Generate a version 4 UUID.\n *\n * Uses Math.random for hexadecimal draws and emits the 36-character grouped\n * form. The fixed-length wrapper rejects bounds that exclude 36 after at most\n * 256 candidates. This helper promises the UUID layout, not cryptographic\n * entropy or uniqueness across invocations.\n *\n * @evidence contracts/common.md#principled-implementation The template `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` is filled with random hexadecimal digits, with the version nibble fixed to 4 and the variant nibble to 8, 9, a or b, which gives a version-4 UUID; its length is fixed, so the length wrapper only accepts or rejects it.\n * @evidence contracts/common.md#clear-and-simple-design One expression over the fixed-length wrapper.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The template is the RFC 4122 layout.\n * @evidence contracts/common.md#meaningful-documentation Native prose states version/layout, source, fixed length and bounded rejection, without promising cryptographic entropy or cross-call uniqueness.\n */\nexport const _randomFormatUuid = (props?: _ILengthProps): string =>\n  _randomFormatLength(props, () =>\n    \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n      const r = (Math.random() * 16) | 0;\n      const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n      return v.toString(16);\n    }),\n  );\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,qBAAqB,UAChC,oBAAoB,aAClB,uCAAuC,QAAQ,UAAU,MAAM;CAC7D,MAAM,IAAK,KAAK,OAAO,IAAI,KAAM;CAEjC,QADU,MAAM,MAAM,IAAK,IAAI,IAAO,EAAA,CAC7B,SAAS,EAAE;AACtB,CAAC,CACH"}