hash

package
v0.0.10-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const HashSize = 32

Variables

This section is empty.

Functions

func HashFunc

func HashFunc(data []byte) []byte

HashFunc is a modified version of the blake2s hash function which sets the first three bits of the output to zero. This is needed for use inside a lurk program which has a max field element value less than the maximum value of the blake2s hash.

func HashMerkleBranches

func HashMerkleBranches(left []byte, right []byte) []byte

HashMerkleBranches takes two hashes, treated as the left and right tree nodes, and returns the hash of their concatenation. This is a helper function used to aid in the generation of a merkle tree.

func HashWithIndex

func HashWithIndex(data []byte, index uint64) []byte

HashWithIndex prepends the index to data before hashing.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL