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 EthereumIsValidAddress(s string) bool
- func Hash(key []byte) []byte
- func HashBytesBuffer(key bytes.Buffer) []byte
- func HashStrToHex(s string) string
- func HashToHex(data []byte) string
- func IntToHex(num uint64) []byte
- func IsValidZetaID(id string) bool
- func IsValidZetaPubKey(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 zeta are checksumed this expects a hex encoded string.
func EthereumIsValidAddress ¶
EthereumIsValidAddress returns whether the given string is a valid ethereum address.
func HashBytesBuffer ¶
func HashStrToHex ¶
HashStrToHex hash a string returns a hex encoded string of the result.
func IsValidZetaID ¶
func IsValidZetaPubKey ¶
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.