hashing

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashFunction added in v2.2.1

type HashFunction func() hash.Hash

HashFunction represents a function that creates a new hash.Hash

Common hash functions

type Hasher added in v2.2.1

type Hasher struct {
	// contains filtered or unexported fields
}

Hasher provides a unified interface for hashing operations

func NewHasher added in v2.2.1

func NewHasher(hf HashFunction) *Hasher

NewHasher creates a new Hasher with the specified hash function

func (*Hasher) CompareBytes added in v2.2.1

func (h *Hasher) CompareBytes(a, b []byte) bool

CompareBytes compares two hashes and returns true if they are equal

func (*Hasher) CompareString added in v2.2.1

func (h *Hasher) CompareString(a, b string) bool

CompareString compares two hashes and returns true if they are equal

func (*Hasher) GetBlockSize added in v2.2.1

func (h *Hasher) GetBlockSize() int

GetBlockSize returns the block size of the hash in bytes

func (*Hasher) GetSize added in v2.2.1

func (h *Hasher) GetSize() int

GetSize returns the size of the hash output in bytes

func (*Hasher) HashBytes added in v2.2.1

func (h *Hasher) HashBytes(data []byte) string

HashBytes returns the hexadecimal hash of the given byte slice

func (*Hasher) HashString added in v2.2.1

func (h *Hasher) HashString(data string) string

HashString returns the hexadecimal hash of the given string input

func (*Hasher) Reset added in v2.2.1

func (h *Hasher) Reset() hash.Hash

Reset creates a new hash.Hash instance

Jump to

Keyboard shortcuts

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