bech32m

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 4 Imported by: 1

README

bech32m

Implementation of bech32m format for segwit addrs

Documentation

Index

Constants

View Source
const (
	Bech32  = 1
	Bech32m = 2
	Failed  = -1
)

Variables

View Source
var (
	ErrMaxLengthExceeded = errors.New("bech32m: overall max length exceeded")
	ErrMixedCase         = errors.New("bech32m: mixed case found in address")
	ErrInvalidChecksum   = errors.New("bech32m: invalid checksum")
	ErrCorruptInput      = errors.New("bech32m: corrupt base32 data")
)

Functions

func Decode

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

Decode validate a Bech32/Bech32m string, and determine HRP and data.

func Encode

func Encode(hrp string, data []byte, spec int) string

Encode compute a Bech32 string given HRP and data values.

func SegwitAddrDecode

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

SegwitAddrDecode decode a segwit address.

func SegwitAddrEncode

func SegwitAddrEncode(hrp string, witver byte, witprog []byte) (string, error)

SegwitAddrEncode encode a segwit address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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