go-pkgs: github.com/iotexproject/go-pkgs/hash Index | Files

package hash

import "github.com/iotexproject/go-pkgs/hash"

Index

Package Files

hash.go

Variables

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

type Hash160 Uses

type Hash160 [20]byte

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

func BytesToHash160 Uses

func BytesToHash160(b []byte) Hash160

BytesToHash160 copies the byte slice into hash

func Hash160b Uses

func Hash160b(input []byte) Hash160

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

func HexStringToHash160 Uses

func HexStringToHash160(s string) (Hash160, error)

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

type Hash256 Uses

type Hash256 [32]byte

Hash256 is 256-bit hash

func BytesToHash256 Uses

func BytesToHash256(b []byte) Hash256

BytesToHash256 copies the byte slice into hash

func Hash256b Uses

func Hash256b(input []byte) Hash256

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

func HexStringToHash256 Uses

func HexStringToHash256(s string) (Hash256, error)

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

Package hash imports 2 packages (graph) and is imported by 33 packages. Updated 2019-07-05. Refresh now. Tools for package owners.