region_code_from_string

Function region_code_from_string 

Source
pub fn region_code_from_string(text: String) -> Result<Vec<u8>, MobileError>
Expand description

Read a region code from what someone typed, yielding the two wire octets used everywhere else in the ULCP and mesh surfaces.

One to three ASCII letters or digits are a short code — an airport, a country, a state — 0xXXXX is a literal code, and anything else is a region name hashed into a part of the code space disjoint from the all-letter short codes. So “SJC” and “San Jose” are deliberately different regions, and no name can ever collide with a letter code.