diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-27 23:36:49 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-27 23:36:49 +0000 |
commit | efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8 (patch) | |
tree | fbb36c13b7526cb3f7d79d364e8b338c4fc81b34 /util/hashes.lua | |
parent | f588a0f5b0dd4c6b6d2c81a517594b50b45fc15b (diff) | |
parent | 631e249397fd7cd2a2c5a7cb4c1feba664a41b2e (diff) | |
download | prosody-efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8.tar.gz prosody-efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8.zip |
Merge from waqas
Diffstat (limited to 'util/hashes.lua')
-rw-r--r-- | util/hashes.lua | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/util/hashes.lua b/util/hashes.lua deleted file mode 100644 index 2fd0fbd8..00000000 --- a/util/hashes.lua +++ /dev/null @@ -1,30 +0,0 @@ - -local softreq = function (...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil; end end -local error = error; - -module "hashes" - -local md5 = softreq("md5"); -if md5 then - if md5.digest then - local md5_digest = md5.digest; - local sha1_digest = sha1.digest; - function _M.md5(input) - return md5_digest(input); - end - function _M.sha1(input) - return sha1_digest(input); - end - elseif md5.sumhexa then - local md5_sumhexa = md5.sumhexa; - function _M.md5(input) - return md5_sumhexa(input); - end - else - error("md5 library found, but unrecognised... no hash functions will be available", 0); - end -else - error("No md5 library found. Install md5 using luarocks, for example", 0); -end - -return _M; |