hash

package
v0.0.0-...-bda66fc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: ISC Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// HashSize of the stored hash
	HashSize = 32
)

Variables

This section is empty.

Functions

func Diff

func Diff(l, r []Hash) ([]Hash, []Hash)

Diff returns the difference between the local and remote hashes

Types

type Hash

type Hash [HashSize]byte

Hash is a wrapper around blake2b

func FromSlice

func FromSlice(s []byte) Hash

FromSlice turns a byte slice into a hash

func New

func New(b []byte) Hash

New generates the digest for a slice

func (Hash) Slice

func (h Hash) Slice() []byte

Slice converts the fixed length hash to a dynamic slice

func (Hash) String

func (h Hash) String() string

func (Hash) Weight

func (h Hash) Weight() int

Weight is the difficulty (or number of leading zeroes) of a site

Jump to

Keyboard shortcuts

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