hasher

package
v0.0.0-...-e976260 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 3 Imported by: 6

Documentation

Overview

Package hasher is responsible for hashing and merging the nodes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeAndHash

func MergeAndHash(hasher types.Hasher, left []byte, right []byte) ([]byte, error)

MergeAndHash appends two bytes and the uses hasher to hash the appended bytes

Types

type Keccak256Hasher

type Keccak256Hasher struct{}

Keccak256Hasher is hasher type for the keccack

func (Keccak256Hasher) Hash

func (hr Keccak256Hasher) Hash(b []byte) ([]byte, error)

Hash generates keccak hash from bytes

type Sha256Hasher

type Sha256Hasher struct{}

Sha256Hasher is hasher type for the sha256

func (Sha256Hasher) Hash

func (hr Sha256Hasher) Hash(b []byte) ([]byte, error)

Hash generates sha256 hash from bytes

Jump to

Keyboard shortcuts

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