hash

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashSize defines the size of hash
	HashSize = 32
	// PKHashSize defines the size of public-key hash
	PKHashSize = 20
	// CacheHashSize defines the size of local hash key
	CacheHashSize = 20
)

Variables

View Source
var (
	// ZeroHash32B is 32-bytes of all zero
	ZeroHash32B = Hash32B{}
	// ZeroPKHash is 20-bytes of all zero
	ZeroPKHash = PKHash{}
)

Functions

func Hash160b

func Hash160b(input []byte) []byte

Hash160b returns 160-bit (20-byte) hash of input

func Hash256b

func Hash256b(input []byte) []byte

Hash256b returns 256-bit (32-byte) hash of input

Types

type CacheHash

type CacheHash [CacheHashSize]byte

CacheHash for 20-byte hash used in cache

type Hash32B

type Hash32B [HashSize]byte

Hash32B is 32-byte hash

func (*Hash32B) SetBytes

func (h *Hash32B) SetBytes(b []byte)

SetBytes copies the byte slice into hash

type PKHash

type PKHash [PKHashSize]byte

PKHash for account and smart contract address hash

Jump to

Keyboard shortcuts

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