hash

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HashSize = 32

Variables

View Source
var UndefHash = Hash{0}

Functions

func Hash160

func Hash160(data []byte) []byte

func Hash256

func Hash256(data []byte) []byte

Types

type Hash

type Hash [HashSize]byte

func CalcHash

func CalcHash(data []byte) Hash

func FromBytes

func FromBytes(data []byte) (Hash, error)

FromBytes constructs a Hash from the raw bytes.

func FromString

func FromString(str string) (Hash, error)

FromString decodes the input string and returns the Hash if the string is a valid hexadecimal encoding of a hash.

func (Hash) Bytes

func (h Hash) Bytes() []byte

Bytes returns the raw byte representation of the hash.

func (Hash) IsUndef

func (h Hash) IsUndef() bool

func (Hash) ShortString added in v0.15.0

func (h Hash) ShortString() string

func (Hash) String

func (h Hash) String() string

String returns the hex-encoded string representation of the hash.

Jump to

Keyboard shortcuts

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