Namespace: joker.crypto
v1.0Contents
Summary
Computes HMACs and common message digests, returning raw digest bytes as strings.
Index
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
(None.)
Functions, Macros, and Special Forms
-
hmac
Function v1.0(hmac algorithm message key)Returns the HMAC of message using key and algorithm as raw bytes.
algorithm must be one of :sha1, :sha224, :sha256, :sha384, or :sha512.
Throws Error for any other algorithm. The returned string is binary digest
data; use joker.hex/encode-string or joker.base64/encode-string when a
printable representation is needed.
Example:
(joker.base64/encode-string
(joker.crypto/hmac :sha256 "message" "secret")) -
md5
Function v1.0(md5 data)Returns the MD5 digest of data as 16 raw bytes.
-
sha1
Function v1.0(sha1 data)Returns the SHA-1 digest of data as 20 raw bytes.
-
sha224
Function v1.0(sha224 data)Returns the SHA-224 digest of data as 28 raw bytes.
-
sha256
Function v1.0(sha256 data)Returns the SHA-256 digest of data as 32 raw bytes.
Example:
(joker.hex/encode-string (joker.crypto/sha256 "hello")) -
sha384
Function v1.0(sha384 data)Returns the SHA-384 digest of data as 48 raw bytes.
-
sha512
Function v1.0(sha512 data)Returns the SHA-512 digest of data as 64 raw bytes.
-
sha512-224
Function v1.0(sha512-224 data)Returns the SHA-512/224 digest of data as 28 raw bytes.
-
sha512-256
Function v1.0(sha512-256 data)Returns the SHA-512/256 digest of data as 32 raw bytes.