royalcms/hashids

Royalcms package for Hashids

v5.0.0 2019-09-04 05:17 UTC

This package is auto-updated.

Last update: 2024-11-05 17:50:56 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

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.