Help us shape the future of Go! Take the 2026 Go Developer Survey

hash

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 160

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ZeroHash256 is 256-bit of all zero
	ZeroHash256 = Hash256{}
	// ZeroHash160 is 160-bit of all zero
	ZeroHash160 = Hash160{}
)

Functions

This section is empty.

Types

type Hash160

type Hash160 [20]byte

Hash160 for 160-bit hash used for account and smart contract address

func BytesToHash160

func BytesToHash160(b []byte) Hash160

BytesToHash160 copies the byte slice into hash

func Hash160b

func Hash160b(input []byte) Hash160

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

func HexStringToHash160 added in v0.1.1

func HexStringToHash160(s string) (Hash160, error)

HexStringToHash160 decodes the hex string, then copy byte slice into hash

type Hash256

type Hash256 [32]byte

Hash256 is 256-bit hash

func BytesToHash256

func BytesToHash256(b []byte) Hash256

BytesToHash256 copies the byte slice into hash

func Hash256b

func Hash256b(input []byte) Hash256

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

func HexStringToHash256 added in v0.1.1

func HexStringToHash256(s string) (Hash256, error)

HexStringToHash256 decodes the hex string, then copy byte slice into hash

Jump to

Keyboard shortcuts

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