Multiformats.Multihash (multiformats_ex v0.2.0)

Handles encoding and decoding multihash binary data, as specified by multiformats.

Summary

Functions

Decodes multihash binary data into a tuple of the hash type, digest size, and digest binary.

Functions

decode(data, opts \\ [])

Decodes multihash binary data into a tuple of the hash type, digest size, and digest binary.

Can pass an option to :base to encode the digest binary into a different format using multibase. Any base supported by Multibase.encode/2 can be used here, otherwise you will receive an error.

encode(data, hash_algorithm)

encode!(data, hash_algorithm)