ADD: SHA1 hashes calculations in sha1.c and LUA

This commit is contained in:
iceman1001 committed 2015-05-26 16:12:33 +02:00
1 parent b69947c245
commit ea75b30c81
5 files changed
+905 -2

No files matched your search

+14 -1
View File
@@ -99,7 +99,20 @@ local Utils =
end
return nil
end,
------------ SHA1 hash
-- Takes a hex string and calculates a SHA1 hash
Sha1 = function(s)
if s == nil then return nil end
if #s == 0 then return nil end
if type(s) == 'string' then
local utils = require('utils')
--local asc = utils.ConvertHexToAscii(s)
local hash = core.sha1(s)
return hash
end
return nil
end,
-- input parameter is a string
-- Swaps the endianess and returns a number,