[BUG] barcode scans are often incorrect

I've found that barcode scans are often incorrect during my tests, Ive mostly been testing UPC's around the house, so I dont know what format they are in.
its tough to give instructions on how to duplicate, but It seems to happen most often when there is a glare on the barcode that reduces visibility or alters the appearance.
My understanding of barcode scanners is that they will use a checksum to validate a scan before it is accepted. this does not seem to be happening, so that's why I'm marking it as a bug. the scanner appears to be very sensitive as compared to, say, the shopify mobile barcode scanner, which by the length of time it takes to scan something and the scanner app they implement has some redundant checking going on.

my current workaround is to build in my own checksum verification function to make sure the scanned barcode is correct before inserting it into the form. see below.

function isValidUPCA(barcode) {
  if (barcode.length !== 12) {
    return false;
  }
  
  let checksum = 0;
  for (let i = 0; i < 11; i++) {
    let digit = parseInt(barcode[i]);
    if (i % 2 === 0) {
      checksum += digit * 3;
    } else {
      checksum += digit;
    }
  }

  let calculatedChecksum = (10 - (checksum % 10)) % 10;
  let scannedChecksum = parseInt(barcode[11]);

  return calculatedChecksum === scannedChecksum;
}

What platform are you scanning on? The iOS and Android implementations are higher quality than the Web one in my experience.

I'm using android and iOS, the iOS scanner seems to make more mistakes than the android though. the web one is super bad at even recognizing barcodes but I just attributed that to the quality of my webcam, or the style of lens that webcam's use. but maybe its the implementation.

We also had this issue, the built in scanners are very low quality compared to what's out there.

We ended up using an iOS keyboard add on that has a scanner option, it's much quicker and accurate!