Documentation ¶
Index ¶
- Constants
- func CountZeros(d []byte) byte
- func Decrypt(data []byte, passphrase string) ([]byte, error)
- func Encrypt(data []byte, passphrase string) ([]byte, error)
- func EthereumChecksumAddress(s string) string
- func Hash(key []byte) []byte
- func HashHexStr(s string) string
- func HashStr(s string) string
- func IntToHex(num uint64) []byte
- func IsValidVegaPubKey(pkey string) bool
- func NewNonce() uint64
- func PoW(blockHash string, txID string, difficulty uint, hashFunction string) (uint64, []byte, error)
- func RandomHash() string
- func Verify(blockHash string, tid string, nonce uint64, hashFuncion string, ...) (bool, byte)
- type PublicKey
Constants ¶
View Source
const (
Sha3 = "sha3_24_rounds"
)
Variables ¶
This section is empty.
Functions ¶
func CountZeros ¶
func EthereumChecksumAddress ¶
EthereumChecksumAddress is a simple utility function to ensure all ethereum addresses used in vega are checksumed this expects a hex encoded string.
func HashHexStr ¶
HashHexStr hash a hex encoded string with sha3 256 returns a hex encoded string of the result.
func HashStr ¶
HashStr hash a string (converts to bytes first) returns a hex encoded string of the result.
func IsValidVegaPubKey ¶
func PoW ¶
func PoW(blockHash string, txID string, difficulty uint, hashFunction string) (uint64, []byte, error)
PoW calculates proof of work given block hash, transaction hash, target difficulty and a hash function. returns the nonce, the hash and the error if any.
func RandomHash ¶
func RandomHash() string
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.