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:

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.
md5:update (data)
Update digest with more data.

Parameters:

md5:final ()
Finalize and return digest.

Returns:

    string Raw 16-byte digest.
generated by LDoc 1.5.0 Last updated 2026-04-09 14:48:22