Cryptographic hash functions using OTP :crypto.
Summary
Functions
Hash160: RIPEMD160(SHA256(data)).
RIPEMD-160 hash.
Constant-time binary comparison.
SHA-256 hash.
HMAC-SHA256.
Double SHA-256 hash.
SHA-512 hash.
Functions
@spec hash160(binary()) :: <<_::160>>
Hash160: RIPEMD160(SHA256(data)).
@spec ripemd160(binary()) :: <<_::160>>
RIPEMD-160 hash.
Constant-time binary comparison.
Prevents timing side-channel attacks when comparing secrets (HMACs, keys, etc.).
Returns true if both binaries are equal, false otherwise.
Always examines every byte regardless of where the first difference occurs.
@spec sha256(binary()) :: <<_::256>>
SHA-256 hash.
HMAC-SHA256.
@spec sha256d(binary()) :: <<_::256>>
Double SHA-256 hash.
@spec sha512(binary()) :: <<_::512>>
SHA-512 hash.