verifyChecksum static method

bool verifyChecksum(
  1. String hrp,
  2. List<int> data, [
  3. Bech32Encodings encoding = Bech32Encodings.bech32
])

Verify the checksum from the specified HRP and converted data characters.

Implementation

static bool verifyChecksum(String hrp, List<int> data,
    [Bech32Encodings encoding = Bech32Encodings.bech32]) {
  final polymod = polyMod([...hrpExpand(hrp), ...data]);
  return polymod == Bech32Const.encodingChecksumConst[encoding];
}