Hashids.new

You're seeing just the function new, go back to Hashids module for more information.

Specs

new(alphabet: binary(), salt: binary(), min_len: non_neg_integer()) :: t()

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.