Documentation ¶
Overview ¶
Package hash defines functions around keccak256 and useful helper functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashStringGetBytes ¶
HashStringGetBytes takes a hex string (which represents a hash) and return the bytes of a hash.Hash object that would return the input string if you called .GetString() on it. This function exists because you can NOT just []byte(hexString) as it would give a different result.
Types ¶
type Hash ¶
type Hash struct {
Bytes []byte
}
Hash has only one field which is the hash as slice of byte.
func Concatenate ¶
Concatenate concatenates two Hashes, hashes it and then returns the resulting Hash. It is used for Merkle Tree construction.
func GetHashObjectWithoutHashing ¶
GetHashObjectWithoutHashing takes a hex string (which represent a hash) and returns a hash.Hash that returns this when called with .GetString() sometimes you already know the hash you want as hex string but you need it as hash.Hash. This function takes care of this situation and is very useful for e.g. GenerateTransaction() which is used for testing.
func NewHash ¶
NewHash is the constructor of Hash which makes sure that the hash function is used correctly.
func (Hash) PrintString ¶
func (h Hash) PrintString()
PrintString prints the hash value as hex string.