Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash []byte
Hash is like multihash.Multihash but also supports serializing to json. It's methods are nil-value safe.
func FromB58String ¶
FromB58String creates a new Hash from a base58 string. (This is shorthand for importing/using &Hash{multihash.FromB58String("xxx")}
func SumWithBackendHash ¶ added in v0.2.0
SumWithBackendHash creates a hash with the same algorithm the backend uses.
func TestDummy ¶
TestDummy returns a blake2b hash based on `seed`. The same `seed` will always generate the same hash.
func (Hash) UnmarshalJSON ¶
UnmarshalJSON loads a base58 string representation of a hash and converts it to raw bytes.
type HashWriter ¶
type HashWriter struct {
// contains filtered or unexported fields
}
HashWriter is a io.Writer that supports being written to.
func NewHashWriter ¶
func NewHashWriter() *HashWriter
NewHashWriter returns a new HashWriter. Currently it is always sha3-256.
func (*HashWriter) Finalize ¶
func (hw *HashWriter) Finalize() Hash
Finalize returns the final hash of the written data.