mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
ADD: SHA1 hashes calculations in sha1.c and LUA
This commit is contained in:
parent
b69947c245
commit
ea75b30c81
5 changed files with 905 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue