Skip to main content

normalize_user_code

Function normalize_user_code 

Source
pub fn normalize_user_code(input: &str) -> Option<String>
Expand description

Formats eight characters of USER_CODE_ALPHABET the way they are shown: WDJB-MJHT.

Reads what a person typed, too: case, the hyphen, spaces and any other character outside the alphabet are ignored, as RFC 8628 ยง6.1 suggests, so wdjb mjht is the same code. None unless exactly eight remain.