Hacker News new | ask | show | jobs
by bouk 2023 days ago
They're not using a hash function: https://en.wikipedia.org/wiki/Format-preserving_encryption
1 comments

There are reversible bit hash functions too.

I've used twang's 64 bit mix in places where the domain is just as big as the hash space - 64 bit to 8 byte hash to 12 byte Y64 strings.

That said, the results are almost always ugly, if I had to do it again, I'd do it the way gfycat does (adjective, adjective, animal).

Thanks for pointing me to the concept of bit mix functions, very interesting.