View Source PerceptibleId (perceptible_id v1.0.0)
Summary
Functions
Returns the default character set used to generate the ID.
Generates a perceptible ID. That defaults to
Generates a perceptible ID of n
length.
Functions
Returns the default character set used to generate the ID.
@spec generate() :: String.t()
Generates a perceptible ID. That defaults to:
- 8 characters in length
- 22 characters.
Examples
iex> PerceptibleId.generate()
"escyphtf"
@spec generate(length :: pos_integer(), opts :: Keyword.t()) :: String.t()
Generates a perceptible ID of n
length.
Options
:include
- a list of characters to potentially include in the ID:exclude
- a list of characters to exclude from ID generation
Examples
iex> PerceptibleId.generate(12)
"bawepsticymj"
iex> PerceptibleId.generate(12, include: ["7", "8", "9"])
"9d7jbowtps3y"
iex> PerceptibleId.generate(12, include: ["1", "2", "3"], exclude: ["h", "a"])
"3msdtj1wecri"