hash

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 2 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HashSize = 32

Variables

This section is empty.

Functions

func CatAndHash

func CatAndHash(data [][]byte) []byte

CatAndHash concatenates all the elements in the slice together and then hashes.

func HashFunc

func HashFunc(data []byte) []byte

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