Closed KyleMaas closed 1 year ago
I don't think this is very useful. QR codes are meant to store text and thus even the "binary" mode is intended to store ISO8859-1 or UTF-8. If you really need to have raw binary data I would suggest using something like base64 to convert it into characters.
In my case, I'm trying to use QR codes as a data storage/transmission medium, not for direct reading. Direct binary would be far more data dense than the way I'm currently having to do it, which is base45-encoded. But I can understand your concern with adding a seldom-useful feature.
It's not even that it would be seldom-used, it's incompatible with QRs and the rest of the library. The other modes aren't even binary, they are packed decimal or even just a proprietary character encoding. For those, there is no other sensible output type except String
. I just can't see it working type-wise to (also) return the binary without heavily compromising the output type or a lot of code duplication.
Okay. Thank you!
A note: the need for storing binary data in qr codes is discussed on quite many places on the internet, and several packages support it. See for example the discussion at:
The maintainers of zbarimg ended up agreeing that supporting binary data is useful, and adding it to zbarimg.
I think that could be a nice feature to have on the roadmap to add in the future :) .
Is there a way to skip the encoding autodetection in the binary mode and just read the raw byte data?
https://github.com/piderman314/bardecoder/blob/e1fcff7f4975c8f9cc430b61b0a0ac29a4b1dd78/src/decode/qr/data.rs#L167-L187