sha256truncated

package
v0.9.3-rc0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sha256truncated provides a sha256 hash.Hash whose output is truncated to 20 bytes (160 bits).

This is the default hashing algorithm used by IAVL+ trees.

s256 := sha256.New() // crypto/sha256
s256Truncated := New() // this package

// Use like any other hash.Hash ...
// Contract:
s256Trunc.Sum(nil) == s256.Sum(nil)[:20]

Index

Constants

View Source
const Size = 20

Variables

This section is empty.

Functions

func Hash

func Hash(input []byte) []byte

func New

func New() hash.Hash

New returns a new hash.Hash computing the truncated to the first 20 bytes SHA256 checksum.

Types

This section is empty.

Jump to

Keyboard shortcuts

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