Documentation
¶
Index ¶
- func ASCII2Hex(s string) []byte
- func ASCII2HexRev(s string) []byte
- func AddByte(one []byte, two byte) []byte
- func AreHexesEqual(one, two []byte) bool
- func AreStringsEqual(one, two string) bool
- func Base582Hex(b string) []byte
- func Big2Hex(b *big.Int) []byte
- func Big2HexPadded(b *big.Int, paddingSize int) []byte
- func Big2HexRev(b *big.Int) []byte
- func Bits2Difficulty(bits uint32) (float64, error)
- func Bits2Target(bits uint32) *big.Int
- func Bits2TargetHex(bits uint32) []byte
- func Bits2TargetHexRev(bits uint32) []byte
- func BitsRev2TargetHexRev(bits uint32) []byte
- func BitsString2TargetHexRev(bits string) []byte
- func Byte2String(b []byte) string
- func CalculateBitMidstate(data []byte) []byte
- func CheckAddressStringValidity(addr string) bool
- func CheckAddressValidity(addr Base58) bool
- func CheckSolution(pubKey, solution, pattern string, netByte byte) (string, string)
- func CombinePrivateKeys(one, two string) *big.Int
- func CombinePublicKeys(one, two string) (*big.Int, *big.Int)
- func ConcatBytes(list ...[]byte) []byte
- func DoubleDoubleSHA(a []byte, b []byte) []byte
- func DoubleSHA(b []byte) []byte
- func DoubleSHAPair(a []byte, b []byte) []byte
- func DoubleSHAPairRev(a []byte, b []byte) []byte
- func DoubleSHARev(b []byte) []byte
- func Float642Str(f float64) string
- func Float642String(f float64) string
- func GenerateMerkleRoot(leafs [][]byte) []byte
- func GenerateMerkleTree(leafs [][]byte) [][]byte
- func GenerateMerkleTreeFromString(leafs []string) []string
- func Hex2Base58Str(val []byte) string
- func Hex2Base58String(val []byte) string
- func Hex2Big(b []byte) *big.Int
- func Hex2Int(b []byte) int
- func Hex2Int64(b []byte) int64
- func Hex2Str(b []byte) string
- func Hex2String(b []byte) string
- func Hex2Uint32(b []byte) uint32
- func Hex2Uint64(b []byte) uint64
- func HexRev2Big(rev []byte) *big.Int
- func HexRev2Str(b []byte) string
- func HexRev2String(b []byte) string
- func HexRev2Uint32(b []byte) uint32
- func HexRev2Uint64(b []byte) uint64
- func Int2BitHex(i int) []byte
- func Int2Hex(i int) []byte
- func Int2Str(i int) string
- func Int2String(i int) string
- func Int642Hex(i64 int64) []byte
- func Int642Str(i int64) string
- func Int642String(i int64) string
- func Makesecp256k1()
- func PointCoordinatesToPublicKey(x, y *big.Int) string
- func PublicKeyToPointCoordinates(pubKey string) (*big.Int, *big.Int)
- func RandomHex(length int) []byte
- func Randuint64() []byte
- func Randuint64Rev() []byte
- func Rev(b []byte) []byte
- func RevTest() bool
- func RevWords(b []byte) []byte
- func RevWords2(b []byte) []byte
- func RevWords2Str(b string) string
- func RevWordsStr(b string) string
- func ReverseByteOrder(b []byte) []byte
- func Ripemd(b []byte) []byte
- func RipemdRev(b []byte) []byte
- func SHARipemd(b []byte) []byte
- func SHARipemdRev(b []byte) []byte
- func SingleSHA(b []byte) []byte
- func SingleSHA1(b []byte) []byte
- func SingleSHA1Rev(b []byte) []byte
- func SingleSHARev(b []byte) []byte
- func SplitStrings(str, separator string) []string
- func Str2Big(s string) *big.Int
- func Str2BigBase(s string, base int) *big.Int
- func Str2Float(s string) float64
- func Str2Hex(s string) []byte
- func Str2HexRev(s string) []byte
- func Str2Int64(s string) int64
- func Str2Uint32(s string) uint32
- func String2Big(s string) *big.Int
- func String2BigBase(s string, base int) *big.Int
- func String2Float(s string) float64
- func String2Hex(s string) []byte
- func String2Hex32(s string) [32]byte
- func String2HexRev(s string) []byte
- func Target2Bits(target *big.Int) uint32
- func Target2Difficulty(target *big.Int) (float64, error)
- func TestBase58()
- func TestBitAddress()
- func TestBitsTargetDifficultyConversions() bool
- func TestCompile() bool
- func TestEverything() bool
- func TestEverythingBitmath() bool
- func TestGenerateMerkleTree() bool
- func TestLen() bool
- func TestVarInt() bool
- func TestVarInt2Hex() bool
- func TestVarInt2HexRev() bool
- func TestVarStr() bool
- func ToLower(s string) string
- func ToUpper(s string) string
- func Uint162Hex(ui uint16) []byte
- func Uint162HexRev(ui uint16) []byte
- func Uint2Hex(ui uint) []byte
- func Uint322Hex(ui uint32) []byte
- func Uint322HexRev(ui uint32) []byte
- func Uint642Hex(ui uint64) []byte
- func Uint642HexRev(ui uint64) []byte
- func VarInt2Hex(vi VarInt) []byte
- func VarInt2HexRev(vi VarInt) []byte
- type Base58
- type BitAddress
- func NewAddressFromPrivateKey(privateKey []byte) (*BitAddress, error)
- func NewAddressFromPrivateKeyOtherNets(netByte byte, privateKey []byte) (*BitAddress, error)
- func NewFromBase(b Base58) *BitAddress
- func NewFromBaseString(s string) *BitAddress
- func NewFromPublicKey(netbyte byte, key []byte) *BitAddress
- func NewFromPublicKeyString(netByte byte, s string) *BitAddress
- func NewRandomAddress() (*BitAddress, error)
- func NewRandomAddressOtherNets(netByte byte) (*BitAddress, error)
- type VarInt
- type VarStr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASCII2HexRev ¶
func AreHexesEqual ¶
func AreStringsEqual ¶
func Bits2Difficulty ¶
TODO: test and add to tests
func BitsRev2TargetHexRev ¶
TODO: test and add to tests
func BitsString2TargetHexRev ¶
func Byte2String ¶
func CalculateBitMidstate ¶
TODO: test and add to tests
func CheckAddressValidity ¶
func CheckSolution ¶
func CombinePrivateKeys ¶
func ConcatBytes ¶
func DoubleDoubleSHA ¶
TODO: test and add to tests double hash input bytes, double hash their concatanation
func DoubleSHAPair ¶
TODO: test and add to tests double SHA-256 hash of a concatenation of the two inputs
func DoubleSHAPairRev ¶
TODO: test and add to tests double SHA-256 hash of a concatenation of the reverse of two inputs
func DoubleSHARev ¶
TODO: test and add to tests reverse double SHA-256 hashing of a single byte array
func Float642Str ¶
func Float642String ¶
func GenerateMerkleRoot ¶
TODO: test and add to tests
func GenerateMerkleTree ¶
TODO: test and add to tests
func GenerateMerkleTreeFromString ¶
TODO: test and add to tests
func Hex2Base58Str ¶
func Hex2Base58String ¶
func Hex2String ¶
func Hex2Uint32 ¶
func Hex2Uint64 ¶
func HexRev2Big ¶
func HexRev2Str ¶
func HexRev2String ¶
func HexRev2Uint32 ¶
func HexRev2Uint64 ¶
func Int2String ¶
func Int642String ¶
func Randuint64 ¶
func Randuint64() []byte
func Randuint64Rev ¶
func Randuint64Rev() []byte
func RevWords2Str ¶
func RevWordsStr ¶
func SHARipemd ¶
TODO: test and add to tests SHA-256 RIPEMD-160 operation for bitcoin address hashing
func SHARipemdRev ¶
TODO: test and add to tests reverse SHA-256 RIPEMD-160 hash
func SingleSHA1 ¶
TODO: test and add to tests Single SHA-1 hashing of a single byte array
func SingleSHA1Rev ¶
Reversed SHA-1 hashing of a single byte array TODO: test and add to tests
func SingleSHARev ¶
TODO: test and add to tests Reversed single SHA-256 hashing of a single byte array
func SplitStrings ¶
func Str2HexRev ¶
func Str2Uint32 ¶
func String2Float ¶
func String2Hex ¶
func String2Hex32 ¶
func String2HexRev ¶
func Target2Difficulty ¶
TODO: test and add to tests
func TestBitAddress ¶
func TestBitAddress()
func TestBitsTargetDifficultyConversions ¶
func TestBitsTargetDifficultyConversions() bool
TODO: expand and add to tests
func TestCompile ¶
func TestCompile() bool
func TestEverythingBitmath ¶
func TestEverythingBitmath() bool
func TestGenerateMerkleTree ¶
func TestGenerateMerkleTree() bool
func TestVarInt ¶
func TestVarInt() bool
func TestVarInt2Hex ¶
func TestVarInt2Hex() bool
func TestVarInt2HexRev ¶
func TestVarInt2HexRev() bool
func TestVarStr ¶
func TestVarStr() bool
func Uint162Hex ¶
func Uint162HexRev ¶
func Uint322Hex ¶
func Uint322HexRev ¶
func Uint642Hex ¶
func Uint642HexRev ¶
func VarInt2Hex ¶
variable-length hex result https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
func VarInt2HexRev ¶
variable-length hex result https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
Types ¶
type Base58 ¶
type Base58 string
type to hold the Base58 string
func StrHex2Base58 ¶
func String2Base58 ¶
func StringHex2Base58 ¶
encodes string stored hex bytes into base58
func (Base58) Base582Big ¶
type BitAddress ¶
type BitAddress struct { PrivateKey []byte //private key, can be encrypted Encrypted bool //checked if the private key is encrypted PublicKey []byte //public key Hash160 []byte //RIPEMD hash Hash []byte //RIPEMD with network bit and checksum Base Base58 //base58 encoded address }
structure to keep different encodings of the bitcoin adress
func NewAddressFromPrivateKey ¶
func NewAddressFromPrivateKey(privateKey []byte) (*BitAddress, error)
func NewAddressFromPrivateKeyOtherNets ¶
func NewAddressFromPrivateKeyOtherNets(netByte byte, privateKey []byte) (*BitAddress, error)
func NewFromBase ¶
func NewFromBase(b Base58) *BitAddress
creates the structure to hold the base58 address
func NewFromBaseString ¶
func NewFromBaseString(s string) *BitAddress
func NewFromPublicKey ¶
func NewFromPublicKey(netbyte byte, key []byte) *BitAddress
TODO: do something for TESTnet? TODO: update and revise creates a bitcoin address from the public key
func NewFromPublicKeyString ¶
func NewFromPublicKeyString(netByte byte, s string) *BitAddress
creates a new bitcoin address from a string representing a public key
func NewRandomAddress ¶
func NewRandomAddress() (*BitAddress, error)
func NewRandomAddressOtherNets ¶
func NewRandomAddressOtherNets(netByte byte) (*BitAddress, error)
func (BitAddress) CheckValidity ¶
func (ba BitAddress) CheckValidity() bool
TODO: do check validity of bitcoin address