I need a Delphi reversible Hashed ID function that is quick.
- Short, obfuscated and efficient IDs
- No collisions (at least up to 32-bit unsigned integer at least)
- Reversible
- Fast
- preferably something that has an input Key, so it can be randomised a bit... otherwise, a '3' will always be 23zkJ5 on all my software modules.
- works cross-platform
Something like Youtube's video identifier.
Encode(3); // => "23zkJ5"
Decode('23zkJ5'); // => 3
PHP seems to have quite a few of these; I can't find one for Delphi.
I look at this but not really what I wanted, plus I need something in Delphi.
$generator->encode(6); // => "43Vht7"
$generator->decode('43Vht7'); // => 6
I need something like what PHP offers:
https://github.com/delight-im/PHP-IDs
I can't use MD5 as it's not reversible; using Lockbox encryption/decryption seems a bit over-kill? (if really no choice, which algorithm in Lockbox would be the best choice for this?)