Skip to main content

normalize

Function normalize 

Source
pub fn normalize(raw: &str) -> String
Expand description

Canonicalises a submitted code so the grouping and the case an operator typed cannot make a correct code fail.

Deliberately no confusable-character fixup (O→0, l→1): the alphabet is RFC 4648 base32, which already excludes 0, 1, 8 and 9, so there is nothing to confuse them with. A fixup would only widen what counts as a match.