MD5 sum in pure Lua, with no C and no external dependencies - Keywords: library love2d hash

Enrique García 21d22c1868 Merge pull request #11 from kikito/pgimeno-fix-large-strings 3 years ago
rockspecs 7fc429b519 add rockspec 4 years ago
spec 8603af5e23 delete long example which is too slow in lua 5.1 3 years ago
.travis.yml 5297100c7c luacheck install fix 3 years ago
MIT-LICENSE.txt dab1b130bd initial commit with working implementation, readme and license 5 years ago 9a87570317 add Positive07 to credits 4 years ago
md5.lua a2144276e1 Merge branch 'fix-large-strings' of into pgimeno-fix-large-strings 3 years ago

md5.lua Build Status

This pure-Lua module computes md5 in Lua 5.1, Lua 5.2 and LuaJIT, using native bit-manipulation libraries when available, and falling back to table-based manipulation of integers in 5.1.

It implements md5.sum and md5.sumhex like the kernel project md5 package, but it's done completely in Lua, with no dependencies on other libs or C files.


local md5 = require 'md5'

local md5_as_hex   = md5.sumhexa(message)   -- returns a hex string
local md5_as_data  = md5.sum(message)     -- returns raw bytes


This is a cleanup of an implementation by Adam Baldwin -

Which in turn was a mix of the bitwise lib, by hanzhao (abrash_han - at -, and, by Equi 4 Software.

Lua 5.2 and LuaJIT compatibility by Positive07


This library, as well as all the previous ones in which is based, is released under the MIT license (See license file for details).


The specs for this library are implemented with busted. In order to run them, install busted and then:

cd path/to/where/the/spec/folder/is