add mongo auth support, and copy a md5 lib to 3rd

This commit is contained in:
Cloud Wu
2014-04-02 14:35:17 +08:00
parent 043311e654
commit 7c43421784
9 changed files with 535 additions and 1 deletions

18
lualib/md5.lua Normal file
View File

@@ -0,0 +1,18 @@
----------------------------------------------------------------------------
-- Modify version from https://github.com/keplerproject/md5
----------------------------------------------------------------------------
local core = require "md5.core"
----------------------------------------------------------------------------
-- @param k String with original message.
-- @return String with the md5 hash value converted to hexadecimal digits
function core.sumhexa (k)
k = core.sum(k)
return (string.gsub(k, ".", function (c)
return string.format("%02x", string.byte(c))
end))
end
return core