bech32

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package bech32 is a modified version of the reference implementation of BIP173.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) (hrp string, data []byte, err error)

Decode decodes a Bech32 string. If the string is uppercase, the HRP will be uppercase. TODO switch to consuming []byte

func Encode

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

Encode encodes the HRP and a bytes slice to Bech32. If the HRP is uppercase, the output will be uppercase.

Types

type Value

type Value struct {
	HRP  string // human-readable part
	Data []byte
}

func (Value) MarshalText

func (value Value) MarshalText() (text []byte, err error)

func (Value) String

func (value Value) String() string

func (*Value) UnmarshalText

func (value *Value) UnmarshalText(text []byte) (err error)

Jump to

Keyboard shortcuts

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