From 24fe17e9e9a67ac558891c84f2b46f82fdf1e259 Mon Sep 17 00:00:00 2001 From: "Thomas J L. Harkness" Date: Tue, 3 Apr 2018 15:44:39 +1000 Subject: [PATCH] Fix for bulk HID card programming and parity issues --- client/scripts/lf_bulk_program.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/scripts/lf_bulk_program.lua b/client/scripts/lf_bulk_program.lua index 6d402dc1..81fb96db 100644 --- a/client/scripts/lf_bulk_program.lua +++ b/client/scripts/lf_bulk_program.lua @@ -61,8 +61,9 @@ local function cardHex(i,f) --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 = bit32.bor(bit32.lshift(id,1), low) bits = bit32.bor(bits, bit32.lshift(high,25))