pub fn decode_string(s: &str) -> Result<DecodedString, Error>Expand description
Decode an mk1 string, validating HRP, case, length, and checksum.
Performs full BCH error correction up to four substitutions
(t = 4 capacity of the BCH(93, 80, 8) regular code and the
BCH(108, 93, 8) long code), via syndrome-based Berlekamp–Massey +
Forney decoding (implemented in the sibling bch_decode module).
Errors:
Error::MixedCaseif the string mixes upper and lower case.Error::InvalidHrpif the HRP is missing or notcrate::consts::HRP.Error::InvalidStringLengthif the data-part length isn’t a valid mk1 length.Error::InvalidCharif the data part contains a non-bech32 character.Error::BchUncorrectableif the checksum can’t be repaired within the BCHt = 4correction radius.