hasher

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package hasher includes a hash.Hash convenient wrapper

Index

Constants

This section is empty.

Variables

View Source
var (
	ChecksumMismatchError = errors.New("checksum mismatch")
)

Functions

This section is empty.

Types

type Hasher

type Hasher struct {
	hash.Hash
}

Hash wraps hash.Hash type

func New

func New() *Hasher

New returns a new instance of Hash

func (*Hasher) HexSum

func (hash *Hasher) HexSum() string

HexSum calculates a checksum and returns a hex representation of it

func (*Hasher) Verify

func (hash *Hasher) Verify(b []byte, h string) error

Verify checks if given bytes' checksum is equal to the one provided

Jump to

Keyboard shortcuts

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