Hashing functions for EDN.
Hashing functions for EDN.
(b64-hash val)Provides a base64 encoded string of the edn-hash of a value val. This contains all bits of the hash compared to 128 bits for the UUID-5. Both should be safe, but b64-hash is safer towards collisions.
Provides a base64 encoded string of the edn-hash of a value val. This contains all bits of the hash compared to 128 bits for the UUID-5. Both should be safe, but b64-hash is safer towards collisions.
(edn-hash val)(edn-hash val write-handlers)(edn-hash val md-create-fn write-handlers)Hash an edn value with SHA-512 by default or a compatible hash function of choice.
Please use the write-handlers only in legacy cases and rather extend the PHashCoercion protocol to your own types.
Hash an edn value with SHA-512 by default or a compatible hash function of choice. Please use the write-handlers only in legacy cases and rather extend the PHashCoercion protocol to your own types.
(hash-ref val)(hash-ref val write-handlers)(hash-ref val md-create-fn write-handlers)Create a HashRef from a value. Stores the -coerce output so that when the HashRef appears inside a larger structure, it produces the same hash as the original value — transparent merkle-style structural hashing.
(edn-hash (hash-ref x)) == (edn-hash x) (uuid {:a (hash-ref x)}) == (uuid {:a x})
Create a HashRef from a value. Stores the -coerce output so that when
the HashRef appears inside a larger structure, it produces the same hash
as the original value — transparent merkle-style structural hashing.
(edn-hash (hash-ref x)) == (edn-hash x)
(uuid {:a (hash-ref x)}) == (uuid {:a x})(squuid)(squuid uuid)Calculates a sequential UUID as described in https://github.com/clojure-cookbook/clojure-cookbook/blob/master/01_primitive-data/1-24_uuids.asciidoc
Calculates a sequential UUID as described in https://github.com/clojure-cookbook/clojure-cookbook/blob/master/01_primitive-data/1-24_uuids.asciidoc
(uuid)(uuid val & {:keys [write-handlers]})Creates random UUID-4 without argument or UUID-5 for the argument value.
Optionally an incognito-style write-handlers map can be supplied, which describes record serialization in terms of Clojure data structures.
Creates random UUID-4 without argument or UUID-5 for the argument value. Optionally an incognito-style write-handlers map can be supplied, which describes record serialization in terms of Clojure data structures.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |