3 ms·
Show HN: Tiny Simple Hash – Passes Dieharder, SMHasher and PractRand
- slowenough 7y agoThe round function is just 4 SLOC: function q( state, val, numerator, denominator ) { // Continued Fraction mixed with Egyptian fraction "Continued Egyptian Fraction" // with denominator = val + pos / state[1] state[0] += numerator / denominator; state[0] = 1.0 / state[0]; // Standard Continued Fraction with a_i = val, b_i = (a_i-1) + i + 1 state[1] += val; state[1] = numerator / state[1]; }