Hashids — generate short and reversable hashes from numbers.
use Hashids; my $hashids = Hashids.new('this is my salt'); # encrypt a single number my $hash = $hashids.encode(123); # 'YDx' my $number = $hashids.decode('Ydx'); # 123 # or a list $hash = $hashids.encode(1, 2, 3); # 'laHquq' my @numbers = $hashids.decode('laHquq'); # (1, 2, 3)
Hashids is designed for use in URL shortening, tracking stuff, validating accounts or making pages private (through abstraction.) Instead of showing items as
3, you could show them as
Aaco9cy5. Hashes depend on your salt value.
IMPORTANT: This implementation follows the v1.0.0 API release of hashids.js.
kalkin- Gadimov email@example.com
Copyright 2016 Bahtiar
MIT License. See the LICENSE file. You can use Hashids in open source projects and commercial products.