mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
chg: adaptation.. made shortcut for Hexlify for ConvertAsciiToHex
This commit is contained in:
parent
6d4d58659f
commit
2919a35665
1 changed files with 23 additions and 21 deletions
|
@ -47,9 +47,9 @@ local Utils =
|
|||
return nil, string.format("Could not read file %s",filename)
|
||||
end
|
||||
local t = infile:read("*all")
|
||||
io.close(infile)
|
||||
len = string.len(t)
|
||||
local _,hex = bin.unpack(("H%d"):format(len),t)
|
||||
io.close(infile)
|
||||
return hex
|
||||
end,
|
||||
|
||||
|
@ -172,10 +172,7 @@ local Utils =
|
|||
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
|
||||
return core.sha1(s)
|
||||
end
|
||||
return nil
|
||||
end,
|
||||
|
@ -326,6 +323,11 @@ local Utils =
|
|||
return table.concat(t)
|
||||
end,
|
||||
|
||||
hexlify = function(s)
|
||||
local u = require('utils')
|
||||
return u.ConvertAsciiToHex(s)
|
||||
end,
|
||||
|
||||
Chars2num = function(s)
|
||||
return (s:byte(1)*16777216)+(s:byte(2)*65536)+(s:byte(3)*256)+(s:byte(4))
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue