fromBech32Address function

String fromBech32Address(
  1. String address
)

Implementation

String fromBech32Address(String address) {
  final Bech32 res = bech32.decode(address);
  final hrp = res.hrp;
  final data = res.data;
  if (hrp != _hrp) {
    throw const InvalidHrp();
  }
  final List<int> buf = _convertBits(data, 5, 8, pad: false);
  return crc32Add(Uint8List.fromList(buf)).toHex();
}