address

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

description: keybox

@author: xwc1125 @date: 2020/8/18 0018

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressToPubKeyRipemd160Hash

func AddressToPubKeyRipemd160Hash(address string) []byte

通过地址获得公钥的ripemd160Hash

func BTCAddress

func BTCAddress(netType BTCNetType, pubKey []byte) string

pubKey := append(private.PublicKey.X.Bytes(), private.PublicKey.Y.Bytes()...)

func CheckSum

func CheckSum(payload []byte) []byte

sha256(sha256(versionPublickeyHash)) 取最后4个字节的值

func IsValidBTCAddress

func IsValidBTCAddress(address string) bool

判断地址是否有效

func Ripemd160Hash

func Ripemd160Hash(publicKey []byte) []byte

对公钥进行sha256散列和ripemd160散列,获得publickeyHash

Types

type BTCNetType

type BTCNetType string
const (
	BTCMainNet  BTCNetType = "mainnet"
	BTCTestNet  BTCNetType = "regtest"
	BTCTestNet3 BTCNetType = "testnet3"
	BTCSimNet   BTCNetType = "simnet"
)

Jump to

Keyboard shortcuts

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