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

Function createDeterministicRandom

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

Source from the content-addressed store, hash-verified

9}
10
11export function createDeterministicRandom(seed: number) {
12 let state = seed >>> 0
13
14 return () => {
15 state = (state * 1664525 + 1013904223) >>> 0
16 return state / 0x100000000
17 }
18}
19
20export function randomSegment(random: () => number) {
21 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