beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / luamd5 / md5.lua
blob0e0c4912dd9b8f8a826b70ccd4852de93904e137
1 -- md5.lua
2 -- (you should put this file in any directory of your LUA_PATH)
5 -- change the next line to point to the md5 dynamic library
7 -- local path = "/usr/local/lua/lib/libmd5.so"
8 --local path = "./libmd5.so"
10 --assert(loadlib(path, "luaopen_md5"))()
13 -- Returns the md5 hash value as a string of hexadecimal digits
15 function md5.sumhexa (k)
16 k = md5.sum(k)
17 return (string.gsub(k, ".", function (c)
18 return string.format("%02x", string.byte(c))
19 end))
20 end
22 return md5