BLC

package
v0.0.0-...-c7dd34c Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(input []byte) []byte

解码函数

Jh83

func Base58Encode

func Base58Encode(input []byte) []byte

编码函数

func CheckSum

func CheckSum(input []byte) []byte

生成校验和

func IsValidForAddress

func IsValidForAddress(addressBytes []byte) bool

判断地址的有效性

func Reverse

func Reverse(data []byte)

反转切片函数

func Ripemd160Hash

func Ripemd160Hash(pubKey []byte) []byte

实现双哈希

Types

type Wallet

type Wallet struct {
	//1.私钥
	PrivateKey ecdsa.PrivateKey
	//2.公钥
	PublicKey []byte
}

钱包基本结构

func NewWallet

func NewWallet() *Wallet

创建一个钱包

func (*Wallet) GetAddress

func (w *Wallet) GetAddress() []byte

通过钱包(公钥)获取地址

type Wallets

type Wallets struct {
	//key : 地址
	//value : 钱包结构
	Wallets map[string]*Wallet
}

实现钱包集合的基本结构

func NewWallets

func NewWallets() *Wallets

初始化钱包集合

func (*Wallets) CreateWallet

func (wallets *Wallets) CreateWallet()

添加新的钱包到集合中

Jump to

Keyboard shortcuts

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