Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, addressing size and encoding considerations.
Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, addressing size and encoding considerations. https://github.com/multiformats/multihash
Hash algorithm identifiers for use in multihashes.
Hash algorithm identifiers for use in multihashes.
(create algorithm digest)
Constructs a new Multihash identifier from the given algorithm key (or numeric code) and digest byte array (or hex string).
Constructs a new Multihash identifier from the given algorithm key (or numeric code) and digest byte array (or hex string).
(decode data)
Decode a multihash by reading data from a byte array.
Decode a multihash by reading data from a byte array.
(encode mhash)
Encode a multihash into a binary representation. Returns the byte array.
Encode a multihash into a binary representation. Returns the byte array.
Map of hash digest functions available.
Map of hash digest functions available.
(hex mhash)
Format a multihash as a hex string.
Format a multihash as a hex string.
(md5 content)
Calculates the md5 digest of the given content and returns a multihash.
Calculates the md5 digest of the given content and returns a multihash.
(read-bytes data offset)
Read a multihash from a byte array. Returns a tuple containing the multihash and the number of bytes read.
Read a multihash from a byte array. Returns a tuple containing the multihash and the number of bytes read.
(sha1 content)
Calculates the sha1 digest of the given content and returns a multihash.
Calculates the sha1 digest of the given content and returns a multihash.
(sha2-256 content)
Calculates the sha2-256 digest of the given content and returns a multihash.
Calculates the sha2-256 digest of the given content and returns a multihash.
(sha2-512 content)
Calculates the sha2-512 digest of the given content and returns a multihash.
Calculates the sha2-512 digest of the given content and returns a multihash.
(test mhash content)
Determines whether a multihash is a correct identifier for some content by recomputing the digest for the algorithm specified in the multihash. Returns nil if either argument is nil, true if the digest matches, or false if not. Throws an exception if the multihash specifies an unsupported algorithm.
Determines whether a multihash is a correct identifier for some content by recomputing the digest for the algorithm specified in the multihash. Returns nil if either argument is nil, true if the digest matches, or false if not. Throws an exception if the multihash specifies an unsupported algorithm.
(write-bytes mhash buffer offset)
Write an encoded multihash to a byte array at the given offset. Returns the number of bytes written.
Write an encoded multihash to a byte array at the given offset. Returns the number of bytes written.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close