lights FAQ Forum   github.com/luapower/hmac
hmac

Hashing & Compression
blake2
sha2
md4
md5
hmac
xxhash
pmurhash
murmurhash3
crc32
zlib
minizip
libsodium

hmac

HMAC hashing


local hmac = require'hmac'

HMAC algorithm per RFC 2104.

hmac.compute(key, message, hash_function, blocksize[, opad][, ipad]) -> hash, opad, ipad Compute a hmac hash based on a hash function. Any function that takes a string as single argument works, like md5.sum. blocksize is that of the underlying hash function, i.e. 64 for MD5 and SHA-256, 128 for SHA-384 and SHA-512.
hmac.new(hash_function, block_size) -> hmac_function hmac_function(message, key) -> hash Returns a HMAC function that can be used with a specific hash function.
hmac.md5(message, key) -> HMAC-MD5 hash Compute HMAC-MD5 (requires md5).
hmac.sha256(message, key) -> HMAC-SHA256 hash hmac.sha384(message, key) -> HMAC-SHA384 hash hmac.sha512(message, key) -> HMAC-SHA512 hash Compute HMAC-SHA2 (requires sha2).

Last updated: 21 months ago | Edit on GitHub

Pkg type:Lua+ffi
Version: r1-9-g6168bd3
Last commit:
License: PD
Requires: glue  luajit  md5  sha2 
Required by: none

Top