contenthash

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0, BSD-3-Clause, MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New returns a new highwayhash128 backed hash instance useful for hashing file and chunk contents.

Types

type Hash added in v0.2.0

type Hash [Size]byte

Hash is a 128bit unique identifier for a chunk or object.

func Cast added in v0.2.0

func Cast(hash []byte) Hash

Cast converts a byte slice to a fixed length hash. In a future version of Go this utility will no longer be necessary.

func Sum

func Sum(data []byte) Hash

Sum returns the hash of a given byte slice.

func SumReader added in v0.2.0

func SumReader(r io.Reader) (Hash, error)

SumReader returns the hash of a given reader.

func (*Hash) MarshalJSON added in v0.2.0

func (h *Hash) MarshalJSON() ([]byte, error)

func (*Hash) UnmarshalJSON added in v0.2.0

func (h *Hash) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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