+/* Prosody IM v0.1
+-- Copyright (C) 2008 Matthew Wild
+-- Copyright (C) 2008 Waqas Hussain
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
/*\r
* hashes.c\r
* Lua library for sha1, sha256 and md5 hashes\r
int hex_out = lua_toboolean(L, 2); \\r
char hash[size]; \\r
char result[size*2]; \\r
- func(s, len, hash); \\r
+ func((const unsigned char*)s, len, (unsigned char*)hash); \\r
if (hex_out) { \\r
toHex(hash, size, result); \\r
lua_pushlstring(L, result, size*2); \\r
{ NULL, NULL }\r
};\r
\r
-LUALIB_API int luaopen_hashes(lua_State *L)\r
+LUALIB_API int luaopen_util_hashes(lua_State *L)\r
{\r
luaL_register(L, "hashes", Reg);\r
lua_pushliteral(L, "version"); /** version */\r