Expand description
proqnt
A pronounceable quintuplet, or proquint, is a pronounceable 5-letter string encoding a unique 16-bit integer.
Proquints may be used to encode binary data such as IP addresses, public keys, and UUIDs in a more human-friendly way. For more information, check out the specification
Basic Usage
use proqnt::{FromProquints, IntoProquints, Proquint};
assert_eq!(
format!("{}", Ipv4Addr::new(127, 0, 0, 1).proquint_encode()),
"lusab-babad"
);
assert!(
Ipv4Addr::new(127, 0, 0, 1).proquint_digits().eq([
u16::parse_proquints("lusab").unwrap(),
u16::parse_proquints("babad").unwrap()
].into_iter())
);
assert_eq!(
format!("{}", [127u8, 0, 0, 1].proquint_encode()),
"lusab-babad"
);
assert!(
Ipv4Addr::new(127, 0, 0, 1).proquint_encode().into_iter().eq([
"lusab".parse::<Proquint>().unwrap(),
"babad".parse::<Proquint>().unwrap()
].into_iter())
);
// NOTE: [127, 0, 0, 1] will yield an array of i32, which will give the wrong result!Modules
- Encoding datatypes as fractional numbers of another datatype
Macros
Structs
- Parse a buffer as a series of dash-separated proquint digits
- Parse a buffer as a series of dash-separated proquints
- A pronounceable quintuplet, or proquint
- Encode data as proquints
- Iterate over some data’s proquint encoding
- An error in parsing a proquint
Enums
- An error which occurs in parsing a stream of proquints
Constants
- A 4-bit mask for the data contained in a proquint consonant
- The mask for the data contained in a proquint’s final consonant
- The shift for the data contained in a proquint’s final consonant
- The mask for the data contained in a proquint’s first consonant
- The shift for the data contained in a proquint’s first consonant
- The mask for the data contained in a proquint’s first syllable
- The shift for the data contained in a proquint’s first syllable
- The mask for the data contained in a proquint’s first vowel
- The shift for the data contained in a proquint’s first vowel
- The consonants which may appear in a proquint, indexed by their 4-bit binary values
- The syllables which may appear in a proquint, indexed by their 6-bit binary values
- The vowels which may appear in a proquint, indexed by their 2-bit binary values
- The mask for the data contained in a proquint’s second consonant
- The shift for the data contained in a proquint’s second consonant
- The mask for the data contained in a proquint’s second syllable
- The shift for the data contained in a proquint’s second syllable
- The mask for the data contained in a proquint’s second vowel
- The shift for the data contained in a proquint’s second vowel
- A 6-bit mask for the data contained in a proquint syllable
- A 2-bit mask for the data contained in a proquint vowel
Traits
- Data which can be constructed from a series of proquints
- Data which can be converted to a series of proquints