Sample
Generate deterministic and custom-entropy identifiers using nanoid customRandom and random byte generator
sha256:e8d4dcdd4cc51c25ef07e9fc78c54cdb1bf4b593d8b7d49f0ca8d5ea7c0a130c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- node
- Operating system
- linux
- Architecture
- x64
- Runtime
- node
- Language
- node
- Package manager
- npm
Verification-run environments
- Execution context
- node 22
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- node 22
- Language
- javascript
- Package manager
- npm
- Execution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Case
- Goal
- Generate deterministic and custom-entropy identifiers using nanoid customRandom and random byte generator HOW
- Packages
-
nanoid 6.0.1
- Environment
- node
- Created
- 2026-08-17T17:45:32Z
Contract
- customRandom generates deterministic identifiers from custom byte generator functions and supports runtime size overrides
- assert customRandom with a seeded generator function produces exact repeatable IDs
- assert customRandom generator respects default size and explicit size overrides
- assert customRandom discards bytes above safe cutoff to prevent modulo bias on non-power-of-two alphabets
- assert random returns Uint8Array buffer of requested byte length and throws RangeError on negative size
- assert urlAlphabet contains 64 unique URL-safe characters
Files
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9