Skip to contents

HMAC (digest's hmac, natively)

Usage

morie_hmac(
  key,
  object,
  algo = c("md5", "sha1", "crc32", "sha256", "sha512", "sha224", "sha384"),
  serialize = FALSE,
  raw = FALSE,
  ...
)

Arguments

key, object

key and message (character, raw, or anything morie_make_raw() accepts).

algo

md5, sha1, crc32, sha256, sha512 (digest's set), plus sha224 / sha384.

serialize, raw, ...

as in digest.

Value

hex digest, or raw with raw = TRUE.

Examples

if (requireNamespace("digest", quietly = TRUE)) {
  morie_hmac("key", "The quick brown fox jumps over the lazy dog", algo = "sha256")
}
#> [1] "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8"