bitcoinmath

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 9 Imported by: 2

README

Bitcoin Math

Build Status Go Report Card Docs License

Bitcoin math library from, the Bitcoin split vanity generator by ThePiachu:

https://github.com/ThePiachu/Split-Vanity-Miner-Golang

This package was created so the specific libraries could be run independently of the project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCII2Hex

func ASCII2Hex(s string) []byte

TODO: test

func ASCII2HexRev

func ASCII2HexRev(s string) []byte

func AddByte

func AddByte(one []byte, two byte) []byte

func AreHexesEqual

func AreHexesEqual(one, two []byte) bool

func AreStringsEqual

func AreStringsEqual(one, two string) bool

func Base582Hex

func Base582Hex(b string) []byte

convert base58 to hex bytes

func Big2Hex

func Big2Hex(b *big.Int) []byte

TODO: test

func Big2HexPadded

func Big2HexPadded(b *big.Int, paddingSize int) []byte

func Big2HexRev

func Big2HexRev(b *big.Int) []byte

TODO: test

func Byte2String

func Byte2String(b []byte) string

func ConcatBytes

func ConcatBytes(list ...[]byte) []byte

func Float642Str

func Float642Str(f float64) string

func Float642String

func Float642String(f float64) string

func Hex2Base58Str

func Hex2Base58Str(val []byte) string

func Hex2Base58String

func Hex2Base58String(val []byte) string

func Hex2Big

func Hex2Big(b []byte) *big.Int

func Hex2Int

func Hex2Int(b []byte) int

func Hex2Int64

func Hex2Int64(b []byte) int64

func Hex2Str

func Hex2Str(b []byte) string

func Hex2String

func Hex2String(b []byte) string

func Hex2Uint32

func Hex2Uint32(b []byte) uint32

func Hex2Uint64

func Hex2Uint64(b []byte) uint64

func HexRev2Big

func HexRev2Big(rev []byte) *big.Int

func HexRev2Str

func HexRev2Str(b []byte) string

func HexRev2String

func HexRev2String(b []byte) string

func HexRev2Uint32

func HexRev2Uint32(b []byte) uint32

func HexRev2Uint64

func HexRev2Uint64(b []byte) uint64

func Int2BitHex

func Int2BitHex(i int) []byte

TODO: test

func Int2Hex

func Int2Hex(i int) []byte

func Int2Str

func Int2Str(i int) string

func Int2String

func Int2String(i int) string

func Int642Hex

func Int642Hex(i64 int64) []byte

func Int642Str

func Int642Str(i int64) string

func Int642String

func Int642String(i int64) string

func RandomHex

func RandomHex(length int) []byte

func Randuint64

func Randuint64() []byte

func Randuint64Rev

func Randuint64Rev() []byte

func Rev

func Rev(b []byte) []byte

TODO: use this function to reverse some of the below functions?

func RevTest

func RevTest() bool

func RevWords

func RevWords(b []byte) []byte

func RevWords2

func RevWords2(b []byte) []byte

func RevWords2Str

func RevWords2Str(b string) string

func RevWordsStr

func RevWordsStr(b string) string

func SplitStrings

func SplitStrings(str, separator string) []string

func Str2Big

func Str2Big(s string) *big.Int

TODO: test

func Str2BigBase

func Str2BigBase(s string, base int) *big.Int

TODO: test

func Str2Float

func Str2Float(s string) float64

func Str2Hex

func Str2Hex(s string) []byte

func Str2HexRev

func Str2HexRev(s string) []byte

func Str2Int64

func Str2Int64(s string) int64

func Str2Uint32

func Str2Uint32(s string) uint32

func String2Big

func String2Big(s string) *big.Int

TODO: test

func String2BigBase

func String2BigBase(s string, base int) *big.Int

TODO: test

func String2Float

func String2Float(s string) float64

func String2Hex

func String2Hex(s string) []byte

func String2Hex32

func String2Hex32(s string) [32]byte

func String2HexRev

func String2HexRev(s string) []byte

func TestBase58

func TestBase58()

TODO: do and test everything

func TestEverything

func TestEverything() bool

TODO: do

func ToLower

func ToLower(s string) string

func ToUpper

func ToUpper(s string) string

func Uint162Hex

func Uint162Hex(ui uint16) []byte

func Uint162HexRev

func Uint162HexRev(ui uint16) []byte

func Uint2Hex

func Uint2Hex(ui uint) []byte

TODO: test

func Uint322Hex

func Uint322Hex(ui uint32) []byte

func Uint322HexRev

func Uint322HexRev(ui uint32) []byte

func Uint642Hex

func Uint642Hex(ui uint64) []byte

func Uint642HexRev

func Uint642HexRev(ui uint64) []byte

Types

type Base58

type Base58 string

type to hold the Base58 string

func Big2Base58

func Big2Base58(val *big.Int) Base58

encodes big.Int to base58 string

func Hex2Base58

func Hex2Base58(val []byte) Base58

encodes hex bytes into base58

func Int2Base58

func Int2Base58(val int) Base58

encodes int to base58 string

func Str2Hex58

func Str2Hex58(val string) Base58

func StrHex2Base58

func StrHex2Base58(val string) Base58

func String2Base58

func String2Base58(val string) Base58

func StringHex2Base58

func StringHex2Base58(val string) Base58

encodes string stored hex bytes into base58

func (Base58) Base582Big

func (b Base58) Base582Big() *big.Int

func (Base58) Base582Int

func (b Base58) Base582Int() int

convert base58 to int

func (Base58) BitHex

func (b Base58) BitHex() []byte

convert base58 to hexes used by Bitcoins (keeping the zeroes on the front, 25 bytes long)

func (Base58) ToBig

func (b Base58) ToBig() *big.Int

Convert base58 to big.Int

func (Base58) ToHex

func (b Base58) ToHex() []byte

convert base58 to hex bytes

func (Base58) ToInt

func (b Base58) ToInt() int

convert base58 to int

Jump to

Keyboard shortcuts

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