mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-07-03 00:40:24 +02:00
Add 'moremesecons_luablock/md5_lua/' from commit 'e8cd75ce397da6dd75ddb37cb07eb31663743223'
git-subtree-dir: moremesecons_luablock/md5_lua git-subtree-mainline:79e856494a
git-subtree-split:e8cd75ce39
This commit is contained in:
55
moremesecons_luablock/md5_lua/README.md
Normal file
55
moremesecons_luablock/md5_lua/README.md
Normal file
@ -0,0 +1,55 @@
|
||||
md5.lua [](https://travis-ci.org/kikito/md5.lua)
|
||||
=========================================================================================================
|
||||
|
||||
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](http://www.keplerproject.org/md5/), but it's done completely in Lua, with no dependencies on other libs or C files.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Simple example:
|
||||
|
||||
local md5 = require 'md5'
|
||||
|
||||
local md5_as_data = md5.sum(message) -- returns raw bytes
|
||||
local md5_as_hex = md5.sumhexa(message) -- returns a hex string
|
||||
local md5_as_hex2 = md5.tohex(md5_as_data) -- returns the same string as md5_as_hex
|
||||
|
||||
Incremental example (for computing md5 of streams, or big files which have to be loaded in chunks - new since 1.1.0):
|
||||
|
||||
local m = md5.new()
|
||||
m:update('some bytes')
|
||||
m:update('some more bytes')
|
||||
m:update('etc')
|
||||
return md5.tohex(m:finish())
|
||||
|
||||
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.
|
||||
|
||||
Lua 5.2 and LuaJIT compatibility by [Positive07](https://github.com/kikito/md5.lua/pull/2)
|
||||
|
||||
A very important fix and the incremental variant by [pgimeno](https://github.com/kikito/md5.lua/pull/10)
|
||||
|
||||
|
||||
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](http://ovinelabs.com/busted/). In order to run them, install busted and then:
|
||||
|
||||
cd path/to/where/the/spec/folder/is
|
||||
busted
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user