mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
ADD: added a simple sleep function. Thanks to Mosci
This commit is contained in:
parent
cd0bed3c98
commit
b9411ebac8
1 changed files with 11 additions and 2 deletions
|
@ -82,8 +82,8 @@ local Utils =
|
||||||
return nil
|
return nil
|
||||||
end,
|
end,
|
||||||
|
|
||||||
------------ CRC-16 ccitt checksums
|
------------ CRC-8 Legic checksums
|
||||||
-- Takes a hex string and calculates a crc16
|
-- Takes a hex string and calculates a crc8
|
||||||
Crc8Legic = function(s)
|
Crc8Legic = function(s)
|
||||||
if s == nil then return nil end
|
if s == nil then return nil end
|
||||||
if #s == 0 then return nil end
|
if #s == 0 then return nil end
|
||||||
|
@ -301,6 +301,15 @@ local Utils =
|
||||||
return n
|
return n
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
-- a simple implementation of a sleep command. Thanks to Mosci
|
||||||
|
-- takes number of seconds to sleep
|
||||||
|
Sleep = function(n)
|
||||||
|
local clock = os.clock
|
||||||
|
local t0 = clock()
|
||||||
|
while clock() - t0 <= n do end
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
|
||||||
-- function convertStringToBytes(str)
|
-- function convertStringToBytes(str)
|
||||||
-- local bytes = {}
|
-- local bytes = {}
|
||||||
-- local strLength = string.len(str)
|
-- local strLength = string.len(str)
|
||||||
|
|
Loading…
Reference in a new issue