Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHash = sha256.New
DefaultHash is a default hashing algorithm - "sha256".
Functions ¶
This section is empty.
Types ¶
type Digest ¶
Digest represents the partial evaluation of a checksum.
func (*Digest) WriteObject ¶
WriteObject adds an interface data to the running hash. It never retruns an error.
type Hash ¶
type Hash []byte
A Hash is a type for representing common hash.
func Decode ¶
Decode decodes the base58 encoded hash. It returns error when a hash isn't base58,encoded or hash length is invalid.
func DecodeFromBytes ¶ added in v0.18.0
DecodeFromBytes decodes hash and checks it length. It returns empty hash on nil slice of bytes.
func Dump ¶
func Dump(v interface{}) Hash
Dump takes an interface and returns its hash representation.
func Int ¶
Int returns a new hash from a given integer. NOTE: This method is for tests purpose only.
func (Hash) MarshalJSON ¶ added in v0.14.0
MarshalJSON mashals hash into encoded json string.
func (*Hash) UnmarshalJSON ¶ added in v0.14.0
UnmarshalJSON unmashals hex encoded json string into hash.