md5 hashing

View on GitHub
Download as .tar.gz
Download as .zip

local md5 = require'md5'

A ffi binding of the popular MD5 implementation by Alexander Peslyak.

md5.sum(s[, size]) -> s
md5.sum(cdata, size) -> s
Compute the MD5 sum of a string or a cdata buffer. Returns the binary representation of the hash. To get the hex representation, use glue.tohex.
md5.digest() -> digest
digest(s[, size])
digest(cdata, size)
digest() -> s
Get a MD5 digest function that can consume multiple data chunks until called with no arguments when it returns the final binary MD5 hash.

See also: sha2