Hashing
xxhash
blake2
sha1
sha2
md5
hmac
|
sha2
SHA-256/-384/-512 hashing
local sha2 = require'sha2'
A ffi binding of Aaron Gifford’s SHA-2 implementation.
sha2.sha256(s[, size]) -> s
sha2.sha256(cdata, size) -> s
sha2.sha384(s[, size]) -> s
sha2.sha384(cdata, size) -> s
sha2.sha512(s[, size]) -> s
sha2.sha512(cdata, size) -> s |
Compute the SHA-2 hash of a string or a cdata buffer. Return the binary representation of the hash. To get the hex representation, use glue.tohex. |
sha2.sha256_digest() -> digest
sha2.sha384_digest() -> digest
sha2.sha512_digest() -> digest
digest(s[, size])
digest(cdata, size)
digest() -> s |
Get a SHA-2 digest function that can consume multiple data chunks until called with no arguments when it returns the final SHA hash. |
sha2.sha256_hmac(s, key) -> s sha2.sha384_hmac(s, key) -> s sha2.sha512_hmac(s, key) -> s |
compute the HMAC-SHA256 of a string. compute the HMAC-SHA384 of a string. compute the HMAC-SHA512 of a string. |
Last updated:
3 years ago
|
Edit on GitHub
|
|