I've never thought about how it works on a technical level, but my guess is you just draw a random line across the image field and the widths of the barcode encoding characters are designed such that the dot-dash pattern produces distinct beat frequencies as the laser traverses. Your "software" is basically a FFT transform and then you look for your target pattern within your designed beat frequency range, so as long as the beam will randomly cross the barcode a reasonable amount the signal will pop out of the noise, and it's completely irrelevant which direction you go (although you do need to go along it not across it - hence it being wide and not square). Yeah it's not zero computational power but by the 70s you can bring a shitty fixed-function FFT chip to market for cheap enough, with the CMOS revolution and all.
People underestimate how much can be done with spectrographic watermarks like that, they're resistant to scaling (because harmonics), rotation and flipping (because it's not about any one position... it's about the beat frequencies between them), translation (of course), etc. That's iirc how the Eurion Constellation works - the patterns form a spectrographic fingerprint, but in 2D instead of just a 1D beat frequency. But it pops right out of a fft so you can put it into random copiers and printers.
I went to look up a source to describe the Eurion Constellation scheme (I'm not sure if an academic description exists given the commercial and sensitive nature?) and they brought up the practice of microprinting (of the super fine lines) and that probably is detectable with FFT and edge detection.
https://murdoch.is/projects/currency/
I wonder if phase (of micro-printed regions) would also work similarly to how frequency fingerprinting does?