Alphabet Type
Represents a validated set of 'letters' from which an identifier is made (for details, see Alphabet.Validate).
Instance members
| Instance member |
Description
|
Full Usage:
this.Letters
Returns: string
|
The validated letter set in this instance.
|
Full Usage:
this.MakeNanoId
Parameters:
int
-
The length of a generated identifier, in number of characters
(note: negative values are changed to zero).
Returns: NanoId
|
|
Full Usage:
this.ParseNanoId
Parameters:
string
-
The raw string to be converted.
Returns: NanoId option
On successful parsing, returns a NanoId instance;
otherwise, returns None.
|
Attempts to convert the given
If the input
|
Full Usage:
this.ParseNonEmptyNanoId
Parameters:
string
-
The raw string to be converted.
Returns: NanoId option
On successful parsing, returns a NanoId instance;
otherwise, returns None.
|
Attempts to convert the given
If the input
|
Static members
| Static member |
Description
|
Full Usage:
Alphabet.Validate(letters)
Parameters:
string
-
The letter set which will ultimately be used to generate
NanoId instances.
Returns: Result<Alphabet, InvalidAlphabet>
On successful validation, returns a Alphabet;
otherwise, returns a InvalidAlphabet
with further details about what went wrong.
|
Builds a new Alphabet from the given letter set after checking that it upholds certain invariants which are necessary for the algorithm to work well. An alphabet's letters MUST uphold the following invariants:
|
ananoid