projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CHG: added a verification to see if the found candidate key was able to validate...
[proxmark3-svn]
/
client
/
lualibs
/
utils.lua
diff --git
a/client/lualibs/utils.lua
b/client/lualibs/utils.lua
index 399c30ed5fdb564823d368d44324ebe572a13df5..39f8bca2041b3a7509496868403a2950672de565 100644
(file)
--- a/
client/lualibs/utils.lua
+++ b/
client/lualibs/utils.lua
@@
-75,15
+75,15
@@
local Utils =
if #s == 0 then return nil end
\r
if type(s) == 'string' then
\r
local utils = require('utils')
\r
if #s == 0 then return nil end
\r
if type(s) == 'string' then
\r
local utils = require('utils')
\r
- local ascii = utils.ConvertHexToAscii(s)
\r
-
local hashed = core.iso14443b_crc(ascii
)
\r
-
return utils.ConvertAsciiToHex(hashed
)
\r
+ return utils.ConvertAsciiToHex(
\r
+
core.iso14443b_crc(s
)
\r
+
)
\r
end
\r
return nil
\r
end,
\r
\r
end
\r
return nil
\r
end,
\r
\r
- ------------ CRC-
16 ccitt
checksums
\r
- -- Takes a hex string and calculates a crc
16
\r
+ ------------ CRC-
8 Legic
checksums
\r
+ -- Takes a hex string and calculates a crc
8
\r
Crc8Legic = function(s)
\r
if s == nil then return nil end
\r
if #s == 0 then return nil end
\r
Crc8Legic = function(s)
\r
if s == nil then return nil end
\r
if #s == 0 then return nil end
\r
@@
-301,6
+301,15
@@
local Utils =
return n
\r
end,
\r
\r
return n
\r
end,
\r
\r
+ -- a simple implementation of a sleep command. Thanks to Mosci
\r
+ -- takes number of seconds to sleep
\r
+ Sleep = function(n)
\r
+ local clock = os.clock
\r
+ local t0 = clock()
\r
+ while clock() - t0 <= n do end
\r
+ return nil
\r
+ end,
\r
+
\r
-- function convertStringToBytes(str)
\r
-- local bytes = {}
\r
-- local strLength = string.len(str)
\r
-- function convertStringToBytes(str)
\r
-- local bytes = {}
\r
-- local strLength = string.len(str)
\r
Impressum
,
Datenschutz