MCPcopy Create free account
hub / github.com/TanStack/router / createDeterministicRandom

Function createDeterministicRandom

benchmarks/memory/client/bench-utils.ts:9–16  ·  view source on GitHub ↗
(seed: number)

Source from the content-addressed store, hash-verified

7}
8
9export function createDeterministicRandom(seed: number) {
10 let state = seed >>> 0
11
12 return () => {
13 state = (state * 1664525 + 1013904223) >>> 0
14 return state / 0x100000000
15 }
16}
17
18export function randomSegment(random: () => number) {
19 return Math.floor(random() * 1_000_000_000).toString(36)

Callers 5

shared.tsFile · 0.90
shared.tsFile · 0.90
createPageIdsFunction · 0.90
createLoaderDataFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected