This commit is contained in:
2025-05-27 18:28:15 -04:00
parent a7881f740a
commit 2bbb91e4f7
2 changed files with 1 additions and 2 deletions
+1 -2
View File
@@ -156,7 +156,7 @@ fn generateChecksum(data: [13]u8) u16 {
const generator_polynomial: u16 = 0x0F35; const generator_polynomial: u16 = 0x0F35;
var checksum: u16 = 0x07ff; var checksum: u16 = 0x07ff;
var byte: u16 = data[0] << 5; var byte: u16 = @as(u16, data[0]) << 5;
for (2..8) |_| { for (2..8) |_| {
if (((checksum ^ byte) & 0x400) != 0) { if (((checksum ^ byte) & 0x400) != 0) {
@@ -207,7 +207,6 @@ fn decode(bars: [65]BarType) Error!BarcodeResult {
8, 11 => { 8, 11 => {
character.* ^= 0b1111111111111; character.* ^= 0b1111111111111;
checksum |= (@as(u11, 1) << @intCast(i)); checksum |= (@as(u11, 1) << @intCast(i));
checksum |= (@as(u11, 1) << @intCast(i));
}, },
2, 5 => {}, 2, 5 => {},
else => return error.DecodingError, else => return error.DecodingError,
BIN
View File
Binary file not shown.