pub struct Profile {Show 17 fields
pub profile_id: String,
pub mode: Mode,
pub body_alphabet: String,
pub body_length: usize,
pub min_length: Option<usize>,
pub checksum_alphabet: String,
pub checksum_length: usize,
pub short_checksum_length: usize,
pub short_checksum_until: usize,
pub case_sensitive: bool,
pub separator: String,
pub separator_min_length: usize,
pub grouping: Vec<usize>,
pub aliases: Vec<(char, char)>,
pub permutation: Permutation,
pub profanity: Option<Profanity>,
pub max_repetition: usize,
}Expand description
A baseH profile. Construct one, pass it to crate::Baseh::new and keep
the resulting codec. Profiles are validated at construction per spec 2.2.
aliases is a list of (source, target) pairs rather than a map so that
duplicate sources (including duplicates that only collide after case
normalization) can be detected during validation.
Fields§
§profile_id: String§mode: ModeFixed keeps the classic constant-width behaviour; expandable gives variable-length codes driven by id magnitude (spec 19).
body_alphabet: String§body_length: usizeFixed mode only; ignored in expandable mode.
min_length: Option<usize>Expandable mode only; None selects the default of 4. When set it
must be a positive integer exceeding checksum_length.
checksum_alphabet: String§checksum_length: usize§short_checksum_length: usizeSpec 22. Expandable mode only. The checksum width used by generations
at or below short_checksum_until; may be 0 (a zero-checksum window:
those generations carry no checksum symbols and no typo detection).
Without a window (short_checksum_until of 0) this must be 0.
short_checksum_until: usizeSpec 22. The last generation (total length) that uses the short
checksum; 0 (the default) turns the feature off (the codebase
convention, like max_repetition). When set it must be an integer from
min_length through 8.
case_sensitive: bool§separator: String§separator_min_length: usizeExpandable mode only; 0 (the default) means the separator always
applies. Must be 0 in fixed mode.
grouping: Vec<usize>§aliases: Vec<(char, char)>§permutation: Permutation§profanity: Option<Profanity>§max_repetition: usizeSpec 21. Maximum allowed run of the same symbol in a raw code. 0
(the default) disables the filter; otherwise it must be at least 3. A
value above the code length is a legal no-op.