html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

Do you support reading of QR-coded binary data into e.g., Uint8Array?

Open psvz opened this issue 2 years ago • 2 comments

Your demo fails at the task hence the question. Example of QRs: https://stackoverflow.com/questions/37996101/storing-binary-data-in-qr-codes

psvz avatar Apr 02 '23 13:04 psvz

Just did some tests using binary data. It is not working as expected. It is building a binary string in such a way that is read as unicode. Seems it uses TextEncoder internally, that mishandle binary data.

jrocha avatar Oct 19 '24 02:10 jrocha

Just pushed up a PR to support this. You'd be able to create a QR code from gzip'd content or a protobuf encoded payload (our use case) or any other binary payload and scan it using this package.

It initially started as a patch file in our project but I figured it'd be worth it to share

ferm10n avatar Mar 02 '25 01:03 ferm10n