Expand description
Utilities for MRZ-specific string operations: validation, trimming a specific character, and OCR-friendly character replacements commonly used when processing MRZ zones.
These functions are intentionally simple and avoid heap allocations where
possible, but return owned String when a transformed string is required.
Functions§
- is_
valid_ mrz_ input - Return
trueifscontains only valid MRZ characters: uppercase A-Z, digits 0-9, or the filler ‘<’. - replace_
angle_ brackets_ with_ spaces - Replace MRZ angle brackets ‘<’ with spaces.
- replace_
similar_ digits_ with_ letters - Replace digits that commonly get misrecognized as letters by OCR:
- replace_
similar_ letters_ with_ digits - Replace letters that commonly get misrecognized as digits by OCR:
- trim_
char - Trim leading and trailing occurrences of the single character
chfrominput. Returns an ownedString.