Hacker News new | past | comments | ask | show | jobs | submit login

Assuming you're talking about an actual barcode scanner device: barcode scanners commonly present as USB keyboards to the OS. The thing about USB keyboards is that events aren't pushed to the computer but are polled at a set rate (commonly 125Hz). It could be that the scanner produces the numbers quick enough to approach the USB polling rate, and maybe Chrome has some additional smarts to handle it, or maybe Firefox just adds a bit of overhead that's enough to lose some of the characters. You could try increasing the computer's polling rate and see if that helps.



The scanner works perfectly in everything except Firefox. I've tried multiple scanners, I've tried different settings. I think I even tried setting an inter-character delay. Firefox is the only thing that seems to drop characters. I basically had to write the back end of my web app to do error checking after the fact and reject barcodes that didn't have the right number of characters. Which doesn't help at all when some barcodes are different lengths. I had to add an extra step for the user to tell the back end how many characters were in the barcode before they can scan one.


Just a guess but you could avoid the step with length input (if the only purpose is to check for errors) if you checked the CRC checksum of the barcode. But that's just an uneducated guess, I have no idea how your app works.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: