bech32

package
v0.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2021 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBits

func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)

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

func Decode(bechString string) (string, []int, error)

Decode decodes bechString(Bech32) returns hrp(human-readable part) and data(32bit data array) / or error

func DecodeBech32

func DecodeBech32(bech string) (string, []byte, error)

Decode decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.

func Encode

func Encode(hrp string, data []int) (string, error)

Encode encodes hrp(human-readable part) and data(32bit data array), returns Bech32 / or error if hrp is uppercase, return uppercase Bech32

func EncodeBech32

func EncodeBech32(hrp string, data []byte) (string, error)

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

func SegwitAddrDecode(hrp, addr string) (int, []int, error)

SegwitAddrDecode decodes hrp(human-readable part) Segwit Address(string), returns version(int) and data(bytes array) / or error

func SegwitAddrEncode

func SegwitAddrEncode(hrp string, version int, program []int) (string, error)

SegwitAddrEncode encodes hrp(human-readable part) , version(int) and data(bytes array), returns Segwit Address / or error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL