pub struct AiidEncodingConfig {
pub key_byte_count: usize,
pub base_parity_byte_count: usize,
pub cap_parity_byte_count: usize,
pub prefix: Vec<u8>,
pub prefix_cap: Vec<u8>,
pub cap_segment_char_count: usize,
pub encoded_char_count: usize,
}Expand description
represents an encoding configuration for aiid rendering and parsing
Fields§
§key_byte_count: usizebyte count of actuall key data that will be encoded
base_parity_byte_count: usizeparity bytes that will be encoded directly into the base32 string (appended after key)
cap_parity_byte_count: usizeparity bytes that will be encoded in the alpha capitalization (appended after base parity)
prefix: Vec<u8>bytes to prefix before rendering to base32
prefix_cap: Vec<u8>binary indication of the capitalization for prefix characters
cap_segment_char_count: usizehow many characters are in a capitalization parity segment
encoded_char_count: usizehow many characters long the fully rendered base32 string should be
Implementations§
Source§impl AiidEncodingConfig
impl AiidEncodingConfig
Sourcepub fn new(kind: &str) -> AiidResult<Self>
pub fn new(kind: &str) -> AiidResult<Self>
create a new config given a kind token string
§Example
let aia0 = aingle_id::AiidEncodingConfig::new("aia0").unwrap();
let aik0 = aingle_id::AiidEncodingConfig::new("aik0").unwrap();
let ais0 = aingle_id::AiidEncodingConfig::new("ais0").unwrap();