util

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(s string) []byte

Base58Decode returns base 58 decodes the argument and returns the result.

func Base64Decode

func Base64Decode(s string) ([]byte, error)

func DecodeVarIntForScript

func DecodeVarIntForScript(buf []byte) (int, int)

script parse 0-10

func DecodeVarIntForTx

func DecodeVarIntForTx(buf []byte) (int, int)

tx parse 0-9

func DoubleHashB

func DoubleHashB(b []byte) []byte

DoubleHashB calculates hash(hash(b)) and returns the resulting bytes.

func DoubleSHA256

func DoubleSHA256(message []byte) []byte

func GetTxID

func GetTxID(hexString string) string

func Hash160

func Hash160(b []byte) []byte

func JsonToAny

func JsonToAny(src interface{}, target interface{}) error

JsonToAny

func JsonToAny2

func JsonToAny2(src interface{}, target interface{}) error

JsonToAny2

func JsonToObject

func JsonToObject(src string, target interface{}) error

JsonToObject

func JsonToObject2

func JsonToObject2(src string, target interface{}) error

JsonToObject2

func LittleEndianBytesToUint32

func LittleEndianBytesToUint32(data []byte) uint32

littleEndianBytesToUint32

func LittleEndianBytesToUint64

func LittleEndianBytesToUint64(data []byte) uint64

littleEndianBytesToUint64

func ObjectToJson

func ObjectToJson(src interface{}) (string, error)

ObjectToJson

func PublicKeyHashToAddress

func PublicKeyHashToAddress(pubKeyHash string, isTestnet ...bool) string

func PublicKeyToAddress

func PublicKeyToAddress(pubKey string, isTestnet ...bool) string

func ReverseBytesToHex

func ReverseBytesToHex(bytesVar []byte) string

reverseBytesToHex change the endian of the input byte array then encode it to hex string

func Ripemd160

func Ripemd160(b []byte) []byte

See https://en.wikipedia.org/wiki/RIPEMD

func SHA256

func SHA256(message []byte) []byte

func Uint32ToLittleEndianBytes

func Uint32ToLittleEndianBytes(data uint32) []byte

uint32ToLittleEndianBytes

func ValueOf

func ValueOf(data interface{}) reflect.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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