More mesecons items
Go to file
Pablo Mayobre 57cc66eba6 Checking the libs doesnt error
Added pcalls instead of raw requires as suggested by Kikito
2015-02-08 07:28:31 -03:00
spec initial commit with working implementation, readme and license 2013-08-30 19:12:29 +02:00
md5.lua Checking the libs doesnt error 2015-02-08 07:28:31 -03:00
MIT-LICENSE.txt initial commit with working implementation, readme and license 2013-08-30 19:12:29 +02:00
README.md Update README.md 2014-02-21 10:09:19 +01:00

md5.lua

This pure-Lua module computes md5 in Lua 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.

Usage

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

Credits

This is a cleanup of an implementation by Adam Baldwin - https://gist.github.com/evilpacket/3647908

Which in turn was a mix of the bitwise lib, http://luaforge.net/projects/bit/ by hanzhao (abrash_han - at - hotmail.com), and http://equi4.com/md5/md5calc.lua, by Equi 4 Software.

License

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

Specs

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
busted