hash

package
v0.0.0-...-24e5678 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashLength is the expected length of the hash
	HashLength = ecommon.HashLength
)

Lengths of hashes and addresses in bytes.

Variables

This section is empty.

Functions

func Uint64

func Uint64(data ...[]byte) uint64

Uint64 calculates and returns uint64 from the Hash hash of the input data.

Types

type Hash256

type Hash256 = ecommon.Hash

func BigToHash

func BigToHash(b *big.Int) Hash256

BigToHash sets byte representation of b to hash. If b is larger than len(h), b will be cropped from the left.

func DoubleHash

func DoubleHash(data ...[]byte) Hash256

DoubleHash hashes twice

func DoubleHashForPubKey

func DoubleHashForPubKey(data []byte) Hash256

func Hash

func Hash(data ...[]byte) Hash256

Hash calculates and returns the Hash hash of the input data.

func HashForPubKey

func HashForPubKey(data []byte) Hash256

func Hashes

func Hashes(hs ...Hash256) Hash256

Hashes returns the result of Hash(h1+'h'+...)

func HexToHash

func HexToHash(s string) Hash256

HexToHash sets byte representation of s to hash. If b is larger than len(h), b will be cropped from the left.

Jump to

Keyboard shortcuts

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