encodeGeneric static method
Encodes data to Bech32 address without version byte.
Implementation
static String encodeGeneric(String hrp, Uint8List data) {
// Cosmos uses Behc32 (original constant 1)
final values = _convertBits(data, 8, 5, true);
final checksum = _createChecksum(
hrp, values, false); // Always false for generic Bech32? Or param?
// Usually generic libraries use constant 1 (Bech32).
final result = StringBuffer(hrp);
result.write('1');
for (final d in [...values, ...checksum]) {
result.write(_charset[d]);
}
return result.toString();
}