hashing

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XorBytes32

func XorBytes32(a [32]byte, b [32]byte) (out [32]byte)

Types

type HashFn

type HashFn func(input []byte) [32]byte

Hashes the input, and returns the hash as a byte slice

var Hash HashFn = sha256.Sum256

Hash the given input. Use a new hashing object, and ditch it after hashing. See GetHashFn for a more efficient approach for repeated hashing. Defaults to SHA-256.

func Sha256Repeat added in v0.7.1

func Sha256Repeat() HashFn

re-uses the sha256 working variables for each new call of a allocated hash-function.

type NewHashFn added in v0.7.1

type NewHashFn func() HashFn
var GetHashFn NewHashFn = Sha256Repeat

Get a hash-function that re-uses the hashing working-variables. Defaults to SHA-256.

Jump to

Keyboard shortcuts

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