Pseudorandom number generator, in full
A PRNG holds an internal state. Each call applies a fixed function to that state, returns a number derived from it, and stores the updated state for next time. Nothing in the process is random. Feed the same seed in and the same sequence comes out, every time, on every machine that implements the arithmetic identically. The output only looks random in the statistical sense: no obvious pattern, a roughly flat distribution, no short repeating cycle.
The formal name in the standards literature is a deterministic random bit generator. NIST's recommendation for them, SP 800-90A, specifies mechanisms built on hash functions or block ciphers, which is the industrial end of the same idea a two-line JavaScript generator sits at.
Daily numbers on Vibe Numbers come from a PRNG, deliberately. core/rng.ts hashes the seed string with xmur3, a small string hash that yields one 32-bit integer, and hands that integer to mulberry32, a compact 32-bit generator returning a float in the range 0 to 1 on each call. mulberry32 advances its state by adding the constant 0x6d2b79f5, then mixes the result with shifts, exclusive-ors and multiplications. Same seed, same numbers, on any device.
Reproducibility is the feature here and a liability elsewhere. A 32-bit state can be recovered by anyone who watches enough output, which rules the generator out for session tokens, keys or a real-money shuffle. Where that line falls, and what the alternatives cost, is the subject of our guide to how random is random.
- Probability
- PRNG, Seeded random number generator
A worked example
Ask for today's numbers with no birth date saved and the seed is just the ISO date and the tool name joined by a middle dot. xmur3 hashes that short string down to one 32-bit integer, the integer initialises mulberry32, and the stream that follows picks the set. Reload the page, switch device, come back at 11pm: identical numbers. At midnight the date changes, the hash changes, and everything downstream changes with it.
Sources
The standards term for a seeded deterministic generator is a deterministic random bit generator, and NIST's recommendation for them specifies mechanisms based on hash functions or block cipher algorithms.
NIST SP 800-90A Rev. 1, Recommendation for Random Number Generation Using Deterministic Random Bit Generators (June 2015)V8, the JavaScript engine in Chrome and Node, implements Math.random with xorshift128+, which is not cryptographically secure.
V8 blog — There's Math.random(), and then there's Math.random()
See also
Where it comes up on this site
Pseudorandom number generator: frequently asked
No. The whole sequence is fixed the moment the seed is chosen, and anyone holding the seed and the algorithm can reproduce it exactly. What a good PRNG gives you is output that passes statistical tests, which is enough for simulation, games and a daily pick you want to stay put.
Yes. V8 uses xorshift128+, and the specification promises no security and no way to set the seed.
So the numbers hold still. Same date and same birth date, same set, at 9am and at 11pm, on a phone and on a laptop.