Show HN: Tiny Simple Hash – Passes Dieharder, SMHasher and PractRand (github.com) 3 points by slowenough 6y ago ↗ HN
[–] slowenough 6y ago ↗ The 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]; }
1 comment
[ 21.5 ms ] story [ 405 ms ] thread