AlphabetExtensions Type
Contains utilities intended to simplify working with Alphabet in languages other than F#.
Static members
| Static member |
Description
|
||
Full Usage:
AlphabetExtensions.ToAlphabet(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:
|
||
|
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:
|
||
Full Usage:
AlphabetExtensions.TryMakeAlphabet(letters, alphabet)
Parameters:
string
-
The letter set which will ultimately be used to generate
NanoId instances.
alphabet : outref<Alphabet>
-
On successful validation, this out parameter will be a Alphabet;
otherwise, it will be null.
Returns: bool
true if validation succeeded and an Alphabet was created;
otherwise, returns false.
|
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:
|
||
Full Usage:
AlphabetExtensions.TryParseNanoId(alphabet, value, nanoId)
Parameters:
Alphabet
-
The letters to check against for validity.
value : string
-
The raw string to be converted.
nanoId : outref<NanoId>
-
On successful parsing, contains a NanoId instance.
Returns: bool
true if parsing succeeded; false otherwise.
|
Attempts to convert the given
If the input
|
||
Full Usage:
AlphabetExtensions.TryParseNonEmptyNanoId(alphabet, value, nanoId)
Parameters:
Alphabet
-
The letters to check against for validity.
value : string
-
The raw string to be converted.
nanoId : outref<NanoId>
-
On successful parsing, contains a NanoId instance.
Returns: bool
true if parsing succeeded; false otherwise.
|
Attempts to convert the given
If the input
|
ananoid