apiculture/alphabet
Alphabet representation and validation.
An alphabet is a validated set of graphemes for direct random character sampling. It is deliberately separate from an encoding, which transforms arbitrary bytes into text.
Types
Values
pub fn characters(alphabet: Alphabet) -> List(String)
Returns the characters in the alphabet as a list of graphemes.
pub fn new_alphabet(
chars: String,
) -> Result(Alphabet, error.Error)
Creates a new alphabet from a string of characters.
Returns an error if the alphabet is empty, has only one character, or contains duplicate characters.