← Back to context

Comment by jcalvinowens

4 days ago

Funny your example is rc5, I wrote exactly what you describe to generate 32-bit cookies in a random prototype a few years ago: https://github.com/jcalvinowens/sdvr/blob/main/rc5.c

It is cute, but surely there's a more efficient way than RC5? There are bijective hash functions which are much cheaper (murmur, at least).

In my case, performance was utterly unimportant.

But is Murmur actually bijective?

  • Mine too, I was just curious.

    I recall empirically determining murmur was bijective across all 32-bit inputs, but I can't find that written down anywhere.