From 089beed4f4a64abf365003e170562531a2077d9c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 29 Mar 2018 13:20:00 +0200 Subject: [PATCH] fix: 'script lf_bulk' - parity fixes (@pwpiwi) --- client/scripts/lf_bulk.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/scripts/lf_bulk.lua b/client/scripts/lf_bulk.lua index 8e6f2e112..7f02094b8 100644 --- a/client/scripts/lf_bulk.lua +++ b/client/scripts/lf_bulk.lua @@ -107,12 +107,12 @@ end local function cardHex(i, f) fac = lshift(f, 16) id = bor(i, fac) - stream = toBits(id, 26) + stream = toBits(id, 24) --As the function defaults to even parity and returns a boolean, --perform a 'not' function to get odd parity - high = not evenparity(string.sub(stream, 0, 12)) and 1 or 0 - low = evenparity(string.sub(stream, 13)) and 1 or 0 + high = evenparity(string.sub(stream,1,12)) and 1 or 0 + low = not evenparity(string.sub(stream,13)) and 1 or 0 bits = bor( lshift(id, 1), low) bits = bor( bits, lshift(high, 25))