MCPcopy Create free account
hub / github.com/codeaashu/claude-code / mulberry32

Function mulberry32

src/buddy/companion.ts:16–25  ·  view source on GitHub ↗
(seed: number)

Source from the content-addressed store, hash-verified

14
15// Mulberry32 — tiny seeded PRNG, good enough for picking ducks
16function mulberry32(seed: number): () => number {
17 let a = seed >>> 0
18 return function () {
19 a |= 0
20 a = (a + 0x6d2b79f5) | 0
21 let t = Math.imul(a ^ (a >>> 15), 1 | a)
22 t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t
23 return ((t ^ (t >>> 14)) >>> 0) / 4294967296
24 }
25}
26
27function hashString(s: string): number {
28 if (typeof Bun !== 'undefined') {

Callers 2

rollFunction · 0.85
rollWithSeedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected