2 ms·
Hashids (https://hashids.org/#how-does-it-work https://hashids.org/#how-does-it-work) have a pretty clever trick for this. They’re able to encode multiple IDs t
by mcintyre1994 5y ago
Hashids (https://hashids.org/#how-does-it-work https://hashids.org/#how-does-it-work) have a pretty clever trick for this. They’re able to encode multiple IDs to a single obfuscated hash, which works by reserving some characters from the alphabet to use as a separator between each encoded value. That guarantees that whatever characters you choose to be separators are never next to each other in the output. By default their separators are (lower + upper case) “c, s, f, h, u, i, t”
It worked surprisingly well when we used it.