MCPcopy Create free account
hub / github.com/dailydotdev/apps / createRandom

Function createRandom

packages/shared/src/features/snapshot/snapshotGradient.ts:22–32  ·  view source on GitHub ↗
(seed: string)

Source from the content-addressed store, hash-verified

20};
21
22const createRandom = (seed: string): (() => number) => {
23 let state = hashSeed(seed) || 1;
24
25 return () => {
26 state += 0x6d2b79f5;
27 let t = state;
28 t = Math.imul(t ^ (t >>> 15), t | 1);
29 t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
30 return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
31 };
32};
33/* eslint-enable no-bitwise */
34
35/**

Callers 1

getSnapshotGradientFunction · 0.85

Calls 1

hashSeedFunction · 0.70

Tested by

no test coverage detected