Documentation ¶
Index ¶
- func AddresBToPubKeyHash(address []byte) ([]byte, error)
- func AddresToPubKeyHash(address string) ([]byte, error)
- func Base58Decode(input []byte) []byte
- func Base58Encode(input []byte) []byte
- func Checksum(payload []byte) []byte
- func CopyBytes(source []byte) []byte
- func DBQuote(str string) string
- func HashPubKey(pubKey []byte) ([]byte, error)
- func IntToHex(num int64) []byte
- func MakeRandomRange(min, max int) []int
- func PubKeyHashToAddres(pubKeyHash []byte) (string, error)
- func PubKeyToAddres(pubKey []byte) (string, error)
- func RandString(n int) string
- func ReverseBytes(data []byte)
- func SignData(privKey ecdsa.PrivateKey, dataToSign []byte) ([]byte, error)
- func SignDataByPubKey(PubKey []byte, privKey ecdsa.PrivateKey, dataToSign []byte) ([]byte, error)
- func SignDataSet(PubKey []byte, privKey ecdsa.PrivateKey, dataSetsToSign [][]byte) ([][]byte, error)
- func StringInSlice(a string, list []string) bool
- func VerifySignature(signature []byte, message []byte, PubKey []byte) (bool, error)
- type LoggerMan
- type MerkleNode
- type MerkleTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddresBToPubKeyHash ¶
func AddresToPubKeyHash ¶
Converts address string to hash of pubkey
func Base58Encode ¶
Base58Encode encodes a byte array to Base58
func DBQuote ¶
Enquotes a string to build safe SQL This should be equivalent to PHP mysql_real_escape_string function
func MakeRandomRange ¶
func PubKeyHashToAddres ¶
Converts hash of pubkey to address as a string
func PubKeyToAddres ¶
Makes string adres from pub key
func RandString ¶
func SignDataByPubKey ¶
func SignDataSet ¶
func StringInSlice ¶
TO check if a string is in slice
Types ¶
type LoggerMan ¶
type LoggerMan struct { State map[string]bool Trace *log.Logger TraceExt *log.Logger Info *log.Logger Warning *log.Logger Error *log.Logger // contains filtered or unexported fields }
Structure to manage logs
func CreateLogger ¶
func CreateLogger() *LoggerMan
Creates logger object. sets all logging to STDOUT
func CreateLoggerStdout ¶
func CreateLoggerStdout() *LoggerMan
func (*LoggerMan) EnableLogs ¶
change enabled logs state
func (*LoggerMan) LogToFiles ¶
func (logger *LoggerMan) LogToFiles(datadir, trace, traceext, info, warning, errorname string) error
Changes logging to files
type MerkleNode ¶
type MerkleNode struct { Left *MerkleNode Right *MerkleNode Data []byte }
MerkleNode represent a Merkle tree node
func NewMerkleNode ¶
func NewMerkleNode(left, right *MerkleNode, data []byte) *MerkleNode
NewMerkleNode creates a new Merkle tree node
type MerkleTree ¶
type MerkleTree struct {
RootNode *MerkleNode
}
MerkleTree represent a Merkle tree
func NewMerkleTree ¶
func NewMerkleTree(data [][]byte) *MerkleTree
NewMerkleTree creates a new Merkle tree from a sequence of data
Click to show internal directories.
Click to hide internal directories.