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 HashHexStrToHex(s string) string
- func HashStrToHex(s string) string
- func HashToHex(data []byte) 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 HashHexStrToHex ¶ added in v0.62.0
HashHexStrToHex hash a hex encoded string with sha3 256 returns a hex encoded string of the result.
func HashStrToHex ¶ added in v0.62.0
HashStrToHex hash a string returns a hex encoded string of the result.
func HashToHex ¶ added in v0.62.0
HashToHex hash the input bytes and 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.