Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Tiny Simple Hash – Passes Dieharder, SMHasher and PractRand (github.com/crislin2046)
3 points by slowenough on Nov 22, 2019 | hide | past | favorite | 1 comment


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];
    }




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: