decodeBech32 method
Decodes a bech32 string into a hex
string and a hrp
human readable part.
final decodedHexString = Nostr.instance.keysService.decodeBech32(npubString);
print(decodedHexString); // ...
Implementation
@override
List<String> decodeBech32(String bech32String) {
const codec = Bech32Codec();
final bech32 = codec.decode(bech32String, bech32String.length);
final eightBitWords = _convertBits(bech32.data, 5, 8, false);
return [HEX.encode(eightBitWords), bech32.hrp];
}