MCPcopy
hub / github.com/paralleldrive/cuid2 / createEntropy

Function createEntropy

src/index.js:34–41  ·  view source on GitHub ↗
(length = 4, rand = random)

Source from the content-addressed store, hash-verified

32const random = createRandom();
33
34const createEntropy = (length = 4, rand = random) => {
35 let entropy = "";
36
37 while (entropy.length < length) {
38 entropy = entropy + Math.floor(rand() * 36).toString(36);
39 }
40 return entropy;
41};
42
43/*
44 * Adapted from https://github.com/juanelas/bigint-conversion

Callers 2

createFingerprintFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…