Expand description
§covo
Consonant-vowel binary encoding for human-pronounceable strings.
let encoded = covo::encode(b"\xCA\xFE");
assert_eq!(encoded, "bafaba-roputa");
assert_eq!(covo::decode(&encoded).unwrap(), b"\xCA\xFE");Encoded strings include a checksum and are self-describing: decode
only needs the alphabet, not the encoder’s configuration. Non-alphabet
characters are silently ignored, so separators and whitespace are
transparent to the decoder.
Use encode / decode with defaults, or encode_with /
decode_with for a custom Alphabet or Config.
Custom alphabets accept English consonants and vowels only (for simplicity and pronounceability).
Structs§
Enums§
Constants§
- BITS_
PER_ PAIR - Encoded bits per CV pair: 4 (consonant) + 2 (vowel).
- DEFAULT
- DEFAULT_
ALPHABET - DEFAULT_
CONSONANTS - Default consonants.
- DEFAULT_
GROUP_ SIZE - Default number of CV pairs (not characters) per group.
- DEFAULT_
SEPARATOR - DEFAULT_
VOWELS - Default vowels.
- MAX_
GROUP_ SIZE - Maximum group size. The
pad_countheader field is 3 bits (0-7), so at most 7 padding pairs can be encoded — but groups that large are impractical (try repeating “vikuhajasovisoju-robinikarobiluju”, two 8-pair groups). - NUM_
CONSONANTS - Number of consonants in the alphabet.
- NUM_
VOWELS - Number of vowels in the alphabet.
Functions§
- decode
- Decode a covo string with the default alphabet.
- decode_
with - Decode a covo string with the given alphabet.
- encode
- Encode binary data with
DEFAULTconfig. - encode_
with - Encode binary data with the given configuration.