encode static method
Encodes data with a Human-Readable Part (HRP) into a Bech32 string.
This method takes an HRP and a byte array and encodes them into a Bech32 string using the standard Bech32 encoding.
hrp
: The Human-Readable Part (prefix) of the Bech32 string.bytes
: The byte array to encode.
Returns the encoded Bech32 string.
Implementation
static String encode(String hrp, List<int> bytes) {
return Bech32EncoderBase.encodeBech32(
hrp,
Bech32BaseUtils.convertToBase32(bytes),
Bech32Const.separator,
Bech32Utils.computeChecksum);
}