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 Hash(key []byte) []byte
- func IntToHex(num uint64) []byte
- 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)
Constants ¶
View Source
const (
Sha3 = "sha3_24_rounds"
)
Variables ¶
This section is empty.
Functions ¶
func CountZeros ¶
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 th error if any.
func RandomHash ¶
func RandomHash() string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.