utils

package
v0.0.0-...-07a8cb0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntFromBitsBytes

func BigIntFromBitsBytes(bits []byte) *big.Int

func BigIntFromBitsHex

func BigIntFromBitsHex(bits string) *big.Int

func BytesIndexOf

func BytesIndexOf(data [][]byte, element []byte) int

func CoinsToSatoshis

func CoinsToSatoshis(coins float64, magnitude int, coinPrecision int) uint64

func CommandStringBytes

func CommandStringBytes(s string) []byte

func FileExists

func FileExists(filename string) bool

func FixedLenStringBytes

func FixedLenStringBytes(s string, l int) []byte

func GetReadableHashRateString

func GetReadableHashRateString(hashrate float64) string

func HexDecode

func HexDecode(b []byte) []byte

func HexEncode

func HexEncode(b []byte) []byte

func Jsonify

func Jsonify(i interface{}) []byte

func JsonifyIndentString

func JsonifyIndentString(i interface{}) string

func MiningKeyToScript

func MiningKeyToScript(addrMiningKey string) []byte

func P2PKHAddressToScript

func P2PKHAddressToScript(addr string) []byte

For POW coins - used to format wallet address for use in generation transaction's output Works for p2pkh only

func P2SHAddressToScript

func P2SHAddressToScript(addr string) []byte

func P2WSHAddressToScript

func P2WSHAddressToScript(addr string) []byte

func PackInt32BE

func PackInt32BE(n int32) []byte

func PackInt64BE

func PackInt64BE(n int64) []byte

func PackUint16BE

func PackUint16BE(n uint16) []byte

func PackUint16LE

func PackUint16LE(n uint16) []byte

func PackUint32BE

func PackUint32BE(n uint32) []byte

func PackUint32LE

func PackUint32LE(n uint32) []byte

func PackUint64BE

func PackUint64BE(n uint64) []byte

func PackUint64LE

func PackUint64LE(n uint64) []byte

func PublicKeyToScript

func PublicKeyToScript(key string) []byte

For POS coins - used to format wallet address for use in generation transaction's output

func RandHexUint64

func RandHexUint64() string

func RandPositiveInt64

func RandPositiveInt64() int64

func Range

func Range(start, stop, step int) []int

range steps between [start, end)

func RawJsonToString

func RawJsonToString(raw json.RawMessage) string

func ReverseByteOrder

func ReverseByteOrder(b []byte) []byte

LE <-> BE

func ReverseBytes

func ReverseBytes(b []byte) []byte

func SatoshisToCoins

func SatoshisToCoins(satoshis uint64, magnitude int, coinPrecision int) float64

func ScriptPubKeyToScript

func ScriptPubKeyToScript(addr string) []byte

func SerializeNumber

func SerializeNumber(n uint64) []byte

func SerializeString

func SerializeString(s string) []byte

func Sha256

func Sha256(b []byte) []byte

func Sha256d

func Sha256d(b []byte) []byte

func StringsIndexOf

func StringsIndexOf(data []string, element string) int

func Uint256BytesFromHash

func Uint256BytesFromHash(h string) []byte

func VarIntBytes

func VarIntBytes(n uint64) []byte

func VarStringBytes

func VarStringBytes(str string) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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