Skip to content

Instantly share code, notes, and snippets.

@Mizux
Mizux / squirrel3.js
Created August 5, 2022 14:29 — forked from psema4/squirrel3.js
An implementation of the Squirrel3 Noise-based RNG
// Based on the GDC 2017 talk "Math for Game Programmers: Noise-Based RNG"
// https://www.youtube.com/watch?v=LWFzPP8ZbdU&ab_channel=GDC
const BIT_NOISE1 = 0xB5297A4D
const BIT_NOISE2 = 0x68E31DA4
const BIT_NOISE3 = 0x1B56C4E9
const PRIME1 = 198491317
const PRIME2 = 6542989
class Squirrel3 {