Liking cljdoc? Tell your friends :D

multiformats.hash

Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, addressing size and encoding considerations.

https://github.com/multiformats/multihash

Multihash is a protocol for differentiating outputs from various
well-established cryptographic hash functions, addressing size and encoding
considerations.

https://github.com/multiformats/multihash
raw docstring

codesclj/s

Hash algorithm identifiers for use in multihashes.

Hash algorithm identifiers for use in multihashes.
sourceraw docstring

createclj/s

(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).
sourceraw docstring

decodeclj/s

(decode data)

Decode a multihash by reading data from a byte array.

Decode a multihash by reading data from a byte array.
sourceraw docstring

encodeclj/s

(encode mhash)

Encode a multihash into a binary representation. Returns the byte array.

Encode a multihash into a binary representation. Returns the byte array.
sourceraw docstring

functionsclj/s

Map of hash digest functions available.

Map of hash digest functions available.
sourceraw docstring

hexclj/s

(hex mhash)

Format a multihash as a hex string.

Format a multihash as a hex string.
sourceraw docstring

md5clj/s

(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.
sourceraw docstring

Multihashcljs

source

parseclj/s

(parse string)

Parse a hex string into a multihash.

Parse a hex string into a multihash.
sourceraw docstring

read-bytesclj/s

(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.
sourceraw docstring

sha1clj/s

(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.
sourceraw docstring

sha2-256clj/s

(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.
sourceraw docstring

sha2-512clj/s

(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.
sourceraw docstring

testclj/s

(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.
sourceraw docstring

write-bytesclj/s

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close