address

package
v6.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: BSD-3-Clause Imports: 6 Imported by: 422

Documentation

Overview

Package address 计算地址相关的函数

Index

Constants

View Source
const MaxExecNameLength = 100

MaxExecNameLength 执行器名最大长度

View Source
const MultiSignVer byte = 5

MultiSignVer 多重签名地址的版本号

View Source
const NormalVer byte = 0

NormalVer 普通地址的版本号

Variables

View Source
var ErrCheckChecksum = errors.New("Address Checksum error")

ErrCheckChecksum :

View Source
var ErrCheckVersion = errors.New("check version error")

ErrCheckVersion :

Functions

func CheckAddress

func CheckAddress(addr string) (e error)

CheckAddress 检查地址

func CheckMultiSignAddress

func CheckMultiSignAddress(addr string) (e error)

CheckMultiSignAddress 检查多重签名地址的有效性

func ExecAddress

func ExecAddress(name string) string

ExecAddress 计算量有点大,做一次cache

func ExecPubKey

func ExecPubKey(name string) []byte

ExecPubKey 计算公钥

func ExecPubkey

func ExecPubkey(name string) []byte

ExecPubkey 计算公钥

func MultiSignAddress

func MultiSignAddress(pubkey []byte) string

MultiSignAddress create a multi sign address

Types

type Address

type Address struct {
	Version  byte
	Hash160  [20]byte // For a stealth address: it's HASH160
	Checksum []byte   // Unused for a stealth address
	Pubkey   []byte   // Unused for a stealth address
	Enc58str string
}

Address 地址

func GetExecAddress

func GetExecAddress(name string) *Address

GetExecAddress 获取地址

func HashToAddress

func HashToAddress(version byte, in []byte) *Address

HashToAddress hash32 to address

func NewAddrFromString

func NewAddrFromString(hs string) (a *Address, e error)

NewAddrFromString new 地址

func PubKeyToAddress

func PubKeyToAddress(in []byte) *Address

PubKeyToAddress 公钥转为地址

func (*Address) SetBytes

func (a *Address) SetBytes(b []byte)

SetBytes 设置地址的bytes

func (*Address) String

func (a *Address) String() string

Jump to

Keyboard shortcuts

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