Optimus (Rust)
With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar to Hashids, but will generate integers instead of random strings.
Usage
To get started you will need 3 things;
- Large prime number lower than
2147483647
- The inverse prime so that
(PRIME * INVERSE) & MAXID == 1
- A large random integer lower than
2147483647
use Optimus;
Inspiration
This package is based on the Go library by pjebs.
Which is in turn based on the PHP library by jenssegers.