hasher

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package hasher provides types and interfaces for hash calculating.

Index

Constants

This section is empty.

Variables

View Source
var ErrDataIsNil = errors.New("data is nil")

ErrDataIsNil is returned if the passed data is nil.

Functions

This section is empty.

Types

type Hasher

type Hasher interface {
	Name() string
	Hash(data []byte) ([]byte, error)
}

Hasher is the interface that storage hashers must implement. It provides low-level operations for hash calculating.

func NewSHA1Hasher

func NewSHA1Hasher() Hasher

NewSHA1Hasher creates a new NewSHA1Hasher instance.

func NewSHA256Hasher

func NewSHA256Hasher() Hasher

NewSHA256Hasher creates a new sha256Hasher instance.

Jump to

Keyboard shortcuts

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