Documentation
¶
Index ¶
- func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)
- func Decode(bechString string) (string, []int, error)
- func DecodeBech32(bech string) (string, []byte, error)
- func Encode(hrp string, data []int) (string, error)
- func EncodeBech32(hrp string, data []byte) (string, error)
- func SegwitAddrDecode(hrp, addr string) (int, []int, error)
- func SegwitAddrEncode(hrp string, version int, program []int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBits ¶
ConvertBits converts a byte slice where each byte is encoding fromBits bits, to a byte slice where each byte is encoding toBits bits.
func Decode ¶
Decode decodes bechString(Bech32) returns hrp(human-readable part) and data(32bit data array) / or error
func DecodeBech32 ¶
Decode decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.
func Encode ¶
Encode encodes hrp(human-readable part) and data(32bit data array), returns Bech32 / or error if hrp is uppercase, return uppercase Bech32
func EncodeBech32 ¶
Encode encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits (base32).
func SegwitAddrDecode ¶
SegwitAddrDecode decodes hrp(human-readable part) Segwit Address(string), returns version(int) and data(bytes array) / or error
Types ¶
This section is empty.