Skip to main content

normalize_connect_code

Function normalize_connect_code 

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

huddle 1.2.1: canonicalize a typed connect code (uppercase, strip spaces / dashes) and validate it’s exactly CONNECT_CODE_LEN Crockford-base32 chars. Returns None for anything that isn’t a well-formed code — so the UIs can tell a connect code apart from an HD-ID (24 hex) or a username, and route “add by …” input to the right path.