ADD: SHA1 hashes calculations in sha1.c and LUA

This commit is contained in:
iceman1001 2015-05-26 16:12:33 +02:00
commit ea75b30c81
5 changed files with 905 additions and 2 deletions

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,