lights FAQ Forum   github.com/luapower/sha2
sha2

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

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.

Last updated: 2 years ago | Edit on GitHub

Pkg type:Lua+ffi
Version: r2-25-g2ff25d2
Last commit:
License: BSD
Import ver: 1.0.1
Requires: luajit 
Required by: hmac 

Top