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

Function idToBigInt

src/test-utils.js:6–10  ·  view source on GitHub ↗
(id, _, __, radix = 36)

Source from the content-addressed store, hash-verified

4export const info = (txt) => console.log(`# - ${txt}`);
5
6export const idToBigInt = (id, _, __, radix = 36) =>
7 [...id.toString()].reduce(
8 (r, v) => r.multipliedBy(radix).plus(parseInt(v, radix)),
9 new BigNumber(0),
10 );
11
12export const buildHistogram = (numbers, bucketCount = 20) => {
13 const buckets = Array(bucketCount).fill(0);

Callers 1

createIdPoolFunction · 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…