hashids v2.0.3 Hashids
Hashids lets you obfuscate numerical identifiers via reversible mapping.
Example
h = Hashids.new(salt: "my salt")
encoded = Hashids.encode(h, [1,2,3])
{:ok, [1,2,3]} = Hashids.decode(h, encoded)
Summary
Functions
Decode the given iodata back into a list of numbers
Decode the given iodata back into a list of numbers
Encode the given number or a list of numbers
Functions
Decode the given iodata back into a list of numbers.
Decode the given iodata back into a list of numbers.
Will raise a Hashids.DecodingError if the provided data is not a valid hash value or a
Hashids struct with incompatible alphabet.
Encode the given number or a list of numbers.
Only non-negative integers are supported.
Create a struct containing the configuration options for Hashids. It should be passed to
encode/2 and decode/2.
Raises Hashids.Error if it encounters an invalid option.
Options
:alphabet– a string of characters to be used in the resulting hash value. By default, characters from the Latin alphabet and digits are used.:salt– a string that will be used to permute the hash value and make it decodable only by using the same salt that was provided during encoding. Default: empty string.:min_len– the minimum length of the resulting hash. Default: 0.