Closed vkammerer closed 2 years ago
I don't know if it helps, but I've also noticed that the buggy codes contain a different number of characters than the working ones.
Thanks @vkammerer, I knew that the base32 had to be padded but I thought the Flutter base32 library handled it. Turns out no, it has a bug in its "padding required" detection where it's checking whether it's a multiple of 2 instead of a multiple of 8! So manually adding in the padding seems to make things work :) Let me know how it goes for you.
Thanks @mogest, that fixes my issue and I am now able to scan the codes I couldn't before.
Question unrelated to this issue: would you be interested in externalising some of your core logic for decoding the QR code into a separate package? The code in cose.dart
, covid_pass.dart
and exceptions.dart
could be hidden behind a public facing API that would be easier for others to consume in their own UI / with the QR code plugin of their choice.
Hello and thank you for the great example,
I am building a NZ Covid Pass Reader application and your repo has been immensely helpful.
However, I have noticed that the QR code is not properly decoded for recent QR codes delivered by the ministry of health, and that it throws an
Invalid Base32 characters
Exception.Do you know how this could be fixed?
In order to reproduce, I have used your first test and could verify that:
code
is set tocode
is set to the value returned from recent QR codes