MCPcopy Index your code
hub / github.com/ulid/javascript / encodeRandom

Function encodeRandom

source/ulid.ts:79–85  ·  view source on GitHub ↗
(len: number, prng: PRNG)

Source from the content-addressed store, hash-verified

77}
78
79export function encodeRandom(len: number, prng: PRNG): string {
80 let str = "";
81 for (; len > 0; len--) {
82 str = randomChar(prng) + str;
83 }
84 return str;
85}
86
87/**
88 * Encode the time portion of a ULID

Callers 2

monotonicFactoryFunction · 0.85
ulidFunction · 0.85

Calls 1

randomCharFunction · 0.85

Tested by

no test coverage detected