encodeBech32 static method

String encodeBech32(
  1. String hex,
  2. String hrp
)

Encode a hex string + human readable part as a bech32 string

Implementation

static String encodeBech32(String hex, String hrp) {
  final bytes = HEX.decode(hex);
  final fiveBitWords = _convertBits(bytes, 8, 5, true);
  return bech32.encode(Bech32(hrp, fiveBitWords), hex.length + hrp.length);
}