Liking cljdoc? Tell your friends :D
Clojure only.

cryptohash-clj.equality


hash=clj

(hash= a b)

Test whether two sequences of characters/bytes are equal in a way that protects against timing attacks. Early aborting occurs if one/both arguments are nil (one => false, both => true), or if the sequences are found to be of different lengths. Note that, the latter can allow an attacker to discover the length of the data being compared. However, in the context of crypto-hashing this is not a concern as the length of a key is typically not considered to be a secret (e.g. BCrypt & the entire SHA family have well-known/fixed key lengths).

Test whether two sequences of characters/bytes are equal in a way that
protects against timing attacks. Early aborting occurs if one/both
arguments are nil (one => false,  both => true), or if the sequences
are found to be of different lengths. Note that, the latter can allow
an attacker to discover the length of the data being compared.
However, in the context of crypto-hashing this is not a concern as the
length of a key is typically not considered to be a secret
(e.g. BCrypt & the entire SHA family have well-known/fixed key lengths).
raw docstring

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

× close