Versions in this module Expand all Collapse all v1 v1.7.1 Jan 29, 2021 v1.7.0 Dec 8, 2020 Changes in this version + const BLAKE2B_MAX + const BLAKE2B_MIN + const BLAKE2S_MAX + const BLAKE2S_MIN + const DBL_SHA2_256 + const ID + const IDENTITY + const KECCAK_224 + const KECCAK_256 + const KECCAK_384 + const KECCAK_512 + const MD5 + const MURMUR3 + const MURMUR3_128 + const POSEIDON_BLS12_381_A1_FC1 + const SHA1 + const SHA2_256 + const SHA2_256_TRUNC254_PADDED + const SHA2_512 + const SHA3 + const SHA3_224 + const SHA3_256 + const SHA3_384 + const SHA3_512 + const SHAKE_128 + const SHAKE_256 + const X11 + var Codes = map[uint64]string + var DefaultLengths = map[uint64]int + var ErrInvalidMultihash = errors.New("input isn't valid multihash") + var ErrLenNotSupported = errors.New("multihash does not yet support digests longer than 127 bytes") + var ErrLenTooLarge = errors.New("requested length was too large for digest") + var ErrSumNotSupported = errors.New("Function not implemented. Complain to lib maintainer.") + var ErrTooLong = errors.New("multihash too long. must be < 129 bytes") + var ErrTooShort = errors.New("multihash too short. must be >= 2 bytes") + var ErrUnknownCode = errors.New("unknown multihash code") + var ErrVarintBufferShort = errors.New("uvarint: buffer too small") + var ErrVarintTooLong = errors.New("uvarint: varint too big (max 64bit)") + var Names = map[string]uint64 + func Encode(buf []byte, code uint64) ([]byte, error) + func EncodeName(buf []byte, name string) ([]byte, error) + func RegisterHashFunc(code uint64, hashFunc HashFunc) error + func ValidCode(code uint64) bool + type DecodedMultihash struct + Code uint64 + Digest []byte + Length int + Name string + func Decode(buf []byte) (*DecodedMultihash, error) + type ErrInconsistentLen struct + func (e ErrInconsistentLen) Error() string + type HashFunc func(data []byte, length int) (digest []byte, err error) + type Multihash []byte + func Cast(buf []byte) (Multihash, error) + func FromB58String(s string) (m Multihash, err error) + func FromHexString(s string) (Multihash, error) + func MHFromBytes(buf []byte) (int, Multihash, error) + func Sum(data []byte, code uint64, length int) (Multihash, error) + func (m *Multihash) HexString() string + func (m *Multihash) String() string + func (m Multihash) B58String() string + type Reader interface + ReadMultihash func() (Multihash, error) + func NewReader(r io.Reader) Reader + type Set struct + func NewSet() *Set + func (s *Set) Add(m Multihash) + func (s *Set) All() []Multihash + func (s *Set) ForEach(f func(m Multihash) error) error + func (s *Set) Has(m Multihash) bool + func (s *Set) Len() int + func (s *Set) Remove(m Multihash) + func (s *Set) Visit(m Multihash) bool + type Writer interface + WriteMultihash func(Multihash) error + func NewWriter(w io.Writer) Writer