ADD: SHA1 hashes calculations in sha1.c and LUA
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user