lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi list,

I have improved a md5 module for Lua, this is based on the lua-md5
module from keplerproject[1]. I have made these improve:

* merge sumhexa into binary, now a simple binary module for lua can
support all md5 functional, needn't a separate pure lua module file.
* add tohex function, to convert any binary string into hex mode.
* import sum and sumhexa function to support calculate hash in segments.

now sum can accept a second state argument. the semantics just
borrowed from slncrypto[2]:

	returns the 16 byte MD5 digest as a string.
md5.sum(data, state)
	if data length is a multiple of 64 byte and not 0,
		returns a state, which is a string of digest, blank and a decimal number
	else only the digest
	use "" as initial state

the same as sumhexa function.


Description: Zip archive