jarviscrypto

package
v0.7.212 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BASE58TABLE = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

BASE58TABLE -

Variables

This section is empty.

Functions

func Base58CheckDecode

func Base58CheckDecode(s string) (ver uint8, b []byte, err error)

Base58CheckDecode - decodes base-58 check encoded string s into a version ver and byte slice b.

func Base58CheckEncode

func Base58CheckEncode(ver uint8, b []byte) (s string)

Base58CheckEncode - encodes version ver and byte slice b into a base-58 check encoded string.

func Base58Decode

func Base58Decode(s string) (b []byte, err error)

Base58Decode - decodes a base-58 encoded string into a byte slice b.

func Base58Encode

func Base58Encode(b []byte) (s string)

Base58Encode - encodes a byte slice b into a base-58 encoded string.

func CheckWIF

func CheckWIF(wif string) (valid bool, err error)

CheckWIF checks that string wif is a valid Wallet Import Format or Wallet Import Format Compressed string. If it is not, err is populated with the reason.

func IntToHex

func IntToHex(num int64) []byte

IntToHex - converts an int64 to a byte array

func ReverseBytes

func ReverseBytes(data []byte)

ReverseBytes - reverses a byte array

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

PrivateKey -

func GenerateKey

func GenerateKey() *PrivateKey

GenerateKey -

func NewPrivateKey

func NewPrivateKey() *PrivateKey

NewPrivateKey -

func (*PrivateKey) FromBytes

func (key *PrivateKey) FromBytes(b []byte) (err error)

FromBytes - converts a 32-byte byte slice to a Bitcoin private key and derives the corresponding Bitcoin public key.

func (*PrivateKey) FromWIFC

func (key *PrivateKey) FromWIFC(wif string) (err error)

FromWIFC converts a Wallet Import Format string to a Bitcoin private key and derives the corresponding Bitcoin public key.

func (*PrivateKey) Sign

func (key *PrivateKey) Sign(data []byte) (r, s *big.Int, err error)

Sign -

func (*PrivateKey) ToAddress

func (key *PrivateKey) ToAddress() (address string)

ToAddress - converts a Bitcoin public key to a compressed Bitcoin address string.

func (*PrivateKey) ToPrivateBytes

func (key *PrivateKey) ToPrivateBytes() []byte

ToPrivateBytes -

func (*PrivateKey) ToPublicBytes

func (key *PrivateKey) ToPublicBytes() (b []byte)

ToPublicBytes - converts a Bitcoin public key to a 33-byte byte slice with point compression.

func (*PrivateKey) ToWIFC

func (key *PrivateKey) ToWIFC() string

ToWIFC - prikey to WIFC

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey -

func NewPublicKey

func NewPublicKey() *PublicKey

NewPublicKey -

func (*PublicKey) FromBytes

func (key *PublicKey) FromBytes(b []byte) (err error)

FromBytes - converts a byte slice (either with or without point compression) to a Bitcoin public key.

func (*PublicKey) ToAddress

func (key *PublicKey) ToAddress() (address string)

ToAddress - converts a Bitcoin public key to a compressed Bitcoin address string.

func (*PublicKey) ToBytes

func (key *PublicKey) ToBytes() (b []byte)

ToBytes - converts a Bitcoin public key to a 33-byte byte slice with point compression.

func (*PublicKey) Verify

func (key *PublicKey) Verify(data []byte, r, s *big.Int) bool

Verify verifies the signature in r, s of hash using the public key, pub. Its return value records whether the signature is valid.

Jump to

Keyboard shortcuts

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