A PHP library for obfuscating integer IDs using Knuth's multiplicative hashing method, generating reversible integer hashes.
Optimus is a PHP library that obfuscates integer IDs using Knuth's multiplicative hashing method, transforming them into reversible integer hashes. It solves the problem of exposing sequential database IDs in URLs or APIs by generating non-sequential, yet decodable, integer representations.
PHP developers building web applications or APIs who need to hide sequential database IDs in URLs, query parameters, or API responses for security or aesthetic reasons.
Developers choose Optimus for its speed, simplicity, and integer-based output, which is more efficient and URL-friendly than string-based alternatives like Hashids, while maintaining full reversibility.
🤖 Id obfuscation based on Knuth's multiplicative hashing method for PHP.
Generates integers instead of strings, making it ideal for URL parameters and API responses where integers are preferred, as stated in the README's focus on URL-friendly obfuscation.
Optimized for speed with minimal overhead, using Knuth's multiplicative hashing method, which is emphasized as 'super fast' in the README for high-traffic applications.
Allows lossless decoding back to original IDs via a mathematical formula, ensuring data integrity without external storage, as shown in the encode/decode examples.
Includes built-in Laravel support and third-party packages for Silex and PSR-15, reducing integration effort in PHP ecosystems, with code examples provided.
Requires manual generation and management of prime, inverse, and random numbers using the CLI tool, adding overhead compared to zero-configuration alternatives like Hashids.
For 32-bit systems or large primes, the GMP extension must be installed separately, as noted in the README, introducing potential compatibility and deployment hurdles.
Less community adoption than string-based tools like Hashids, with fewer third-party integrations and resources, which may increase maintenance risk for some projects.
Optimus is an open-source alternative to the following products:
Automatic SQL injection and database takeover tool
The ZAP by Checkmarx Core project
PHP Secure Communications Library
Simple Encryption in PHP.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.