Core multihash type definition and helper methods.
Core multihash type definition and helper methods.
Map of information about the available content hashing algorithms.
Map of information about the available content hashing algorithms.
(app-code? code)
True if the given code number is assigned to the application-specfic range. Returns nil if the argument is not an integer.
True if the given code number is assigned to the application-specfic range. Returns nil if the argument is not an integer.
(base58 mhash)
Encodes a multihash into a Base-58 string.
Encodes a multihash into a Base-58 string.
(create algorithm digest)
Constructs a new Multihash identifier. Accepts either a numeric algorithm code or a keyword name as the first argument. The digest may either by a byte array or a hex string.
Constructs a new Multihash identifier. Accepts either a numeric algorithm code or a keyword name as the first argument. The digest may either by a byte array or a hex string.
This protocol provides a method for data sources which a multihash can be read from.
This protocol provides a method for data sources which a multihash can be read from.
(decode source)
Attempts to read a multihash value from the data source.
Attempts to read a multihash value from the data source.
(decode-array encoded)
Decodes a byte array directly into multihash. Throws ex-info
with a :type
of :multihash/bad-input
if the data is malformed or invalid.
Decodes a byte array directly into multihash. Throws `ex-info` with a `:type` of `:multihash/bad-input` if the data is malformed or invalid.
(encode mhash)
Encodes a multihash into a binary representation.
Encodes a multihash into a binary representation.
(get-algorithm value)
Looks up an algorithm by keyword name or code number. Returns nil
if the
value does not map to any valid algorithm.
Looks up an algorithm by keyword name or code number. Returns `nil` if the value does not map to any valid algorithm.
(hex mhash)
Encodes a multihash into a hexadecimal string.
Encodes a multihash into a hexadecimal string.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close