payexpress_addrdec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = AddressDecoderV2{}
)
View Source
var ErrInvalidChecksum = errors.New("invalid checksum")

ErrInvalidChecksum is returned when Validate determines either the checksum or the payload has been corrupted

View Source
var ErrInvalidVersionByte = errors.New("invalid version byte")

ErrInvalidVersionByte is returned when the version byte from a provided strkey-encoded string is not one of the valid values.

Functions

func Checksum

func Checksum(data []byte) []byte

Checksum returns the 2-byte checksum for the provided data

func Validate

func Validate(data []byte, expected []byte) error

Validate returns an error if the provided checksum does not match the calculated checksum of the provided data

Types

type AddressDecoderV2

type AddressDecoderV2 struct {
}

AddressDecoderV2

func (*AddressDecoderV2) AddressDecode

func (dec *AddressDecoderV2) AddressDecode(addr string, opts ...interface{}) ([]byte, error)

AddressDecode 地址解析

func (*AddressDecoderV2) AddressEncode

func (dec *AddressDecoderV2) AddressEncode(hash []byte, opts ...interface{}) (string, error)

AddressEncode 地址编码

type VersionByte

type VersionByte byte

VersionByte represents one of the possible prefix values for a StrKey base string--the string the when encoded using base32 yields a final StrKey.

const (
	//VersionByteAccountID is the version byte used for encoded stellar addresses
	VersionByteAccountID VersionByte = 6 << 3 // Base32-encodes to 'G...'
)

Jump to

Keyboard shortcuts

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