Module eco.hash.md5
MD5 hash functions.
Provides one-shot hashing via sum and incremental hashing via new. The digest is returned as raw binary bytes (16 bytes).
Functions
| sum (data) | Compute MD5 digest of the given data. |
| new () | Create a new incremental MD5 context. |
Class md5
| md5:update (data) | Update digest with more data. |
| md5:final () | Finalize and return digest. |
Functions
- sum (data)
-
Compute MD5 digest of the given data.
Parameters:
- data string Input bytes.
Returns:
-
string
Raw 16-byte digest.
- new ()
-
Create a new incremental MD5 context.
Returns:
-
md5
ctx
Usage:
local md5 = require 'eco.hash.md5' local ctx = md5.new() ctx:update('hello') ctx:update('world') local digest = ctx:final()
Class md5
md5 object created by new.