3 ms·
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/s
by jcalvinowens 8mo 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 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).
- cyberax 8mo agoIn my case, performance was utterly unimportant. But is Murmur actually bijective?
- jcalvinowens 8mo agoMine 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.