bech32 0.1.1 bech32: ^0.1.1 copied to clipboard
Library implementing Bitcoins BIP173 (Bech32 encoding) specification in a Flutter friendly fashion.
import 'package:hex/hex.dart';
import 'package:bech32/bech32.dart';
void main() {
Segwit address = segwit.decode(
"bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx");
print("scriptPubKey: ${address.scriptPubKey}");
print("version: ${address.version}");
print("program: ${address.program}");
Segwit otherAddress = Segwit('bc', 1, [0, 0]);
print(segwit.encode(otherAddress));
Segwit yetAnOtherAddress = Segwit('bc', 0, HEX.decode("751e76e8199196d454941c45d1b3a323f1433bd6"));
print(segwit.encode(yetAnOtherAddress));
}