Download the PHP package delight-im/ids without Composer
On this page you can find all versions of the php package delight-im/ids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download delight-im/ids
More information about delight-im/ids
Files in delight-im/ids
Download delight-im/ids
More information about delight-im/ids
Files in delight-im/ids
Vendor delight-im
Package ids
Short Description Short, obfuscated and efficient IDs for PHP
License MIT
Homepage https://github.com/delight-im/PHP-IDs
Package ids
Short Description Short, obfuscated and efficient IDs for PHP
License MIT
Homepage https://github.com/delight-im/PHP-IDs
Please rate this library. Is it a good library?
Informations about the package ids
PHP-IDs
Short, obfuscated and efficient IDs for PHP
No database changes are required. The original (integer) IDs are all you need.
No collisions. Reversible.
Why do I need this?
- Don't leak information to your competitors (e.g. number of orders, sign-ups per day)
- Prevent resource enumeration by waiving sequential IDs
- Mix up IDs a little bit in order to make guessing them harder
Security through obscurity
Requirements
- PHP 5.6.0+
- GMP extension
Installation
-
Include the library via Composer [?]:
- Include the Composer autoloader:
Usage
Creating an instance
Encoding and decoding IDs
Shortening a number without obfuscating it
Obfuscating a number without shortening it
Customization
- Shuffle the characters of the alphabet that is used for the base conversion. Calling
\Delight\Ids\Id::createRandomAlphabet()
may be helpful for that purpose. You might also change the alphabet entirely, but there's usually no need to do that. - Pass your new alphabet to the constructor as the first argument.
- Clone this repository and then execute the file
tests/index.php
to generate your custom prime number, inverse prime and random number for Knuth's multiplicative hashing. - Pass your three new numbers to the constructor as the second, third and fourth argument, respectively.
Contributing
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
License
This project is licensed under the terms of the MIT License.
All versions of ids with dependencies
PHP Build Version
Package Version
The package delight-im/ids contains the following files
Loading the files please wait ....