Bech32 class

Encapsules 5-bit words that can be bech32 encoded and decoded. The 5-bit words may need to be further converted into the required data.

Constructors

Bech32.new({required String hrp, required List<int> words, required Bech32Type type})
Creates an encodable object with the human-readable-part (hrp), words for the given bech32 type (bech32 or bech32m).
Bech32.decode(String encoded)
Decodes a bech32 string into the hrp, 5-bit words and type. May throw an InvalidBech32. It will throw InvalidBech32Checksum if the bech32 is valid but doesn't have a valid checksum for either bech32 or bech32m.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
hrp String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Bech32Type
final
words List<int>
final

Methods

encode() String
Encodes a bech32 string
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

bech32CheckConst → const int
bech32mCheckConst → const int
checksumLength → const int
maxLength → const int