fn bech32_check_hrp(hrp: &str) -> Result<Bech32Case, Error>
Expand description

Check if the HRP is valid. Returns the case of the HRP, if any.

§Errors

  • MixedCase: If the HRP contains both uppercase and lowercase characters.
  • InvalidChar: If the HRP contains any non-ASCII characters (outside 33..=126).
  • InvalidLength: If the HRP is outside 1..83 characters long.