royalcms / hashids
Royalcms package for Hashids
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/royalcms/hashids
Requires
- php: >=5.4.0
- hashids/hashids: 1.0.6
This package is auto-updated.
Last update: 2025-11-05 20:09:15 UTC
README
A hashids wrapper for Royalcms Component.
Installation
Facade
To add facade support for Royalcms, add the following line inside your config/facade.php under the alias section...
'RC_Hashids' => 'Royalcms\Component\Hashids\Facades\Hashids',
then add the following to your .env file:
# HASHIDS HASHIDS_SALT = YOURSECRETKEY HASHIDS_LENGTH = 8 HASHIDS_ALPHABET = abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPAQRSTUVWXYZ1234567890
Settings
| name | description | default |
|---|---|---|
| salt | The secret used for hashing. | MYREALLYSECRETSALT |
| length | The maximum length of the hash. | 10 |
| alphabet | The characters used for hashing. | abcedefghijklmnopqrstuvwxyzABCEDEFGHIJKLMNOPQRSTUVWXYZ123456890 |
Usage
Encode
Encode a series of integers
royalcms('hashids')->encode(...$integers);
or with the facade
RC_Hashids::encode(...$integers);
Decode
Decode a encoded string back to the original integers
royalcms('hashids')->decode($encoded);
or with the facade
RC_Hashids::decode($encoded);
License
This library is licensed under MIT, see license.md for details.