Skip Navigation

Checking if a hash is collision free on a limited domain

lexp.lt Checking the collision \

# Why? In a work related context, I had to create a hash algorithm working on a finite set of values ([0, 0xFFFFFFFF]) to output a non sequential serie from a sequential one (the output had to be rendered as a UUID. Basically, I wanted to avoid generating UUID looking like 00000000-0000-0000-0000-00...

I had some fun trying to check if a hash (more like a transformation really) was collision free, so I wrote a quick piece code and then iterated on it so that it was usable.

I might add a quick bench and graphs and try to push it even further just for fun, to explore std::future a bit more (though the shared bit set might be a problem unless you put a shared condition variable on it to allow concurrent read but block concurrent writes?)

3
3 comments