Also depending on your application you could buy a hardware scanner like https://www.zebra.com/us/en/products/scanners/fixed-mount-sc... for cheap secondhand since they are all over retail. The protocol can be as simple as it “types” the barcode over USB HID like a keyboard, or there are more specialized modes.