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:
- the tests passes when
code
is set to
- the example shown on the official documentation
- one of my friends code, who downloaded his pass very early on (can't give a more precise date sorry)
- the test throws the above Exception when
code
is set to the value returned from recent QR codes
test('Holder information is returned from a valid COVID Pass', () async {
var code = "NZCP:/1/2KCEVIQEIVVWK6JNGEASNICZAEP2KALYDZSGSZB2O5SWEOTOPJRXALTDN53GSZBRHEXGQZLBNR2GQLTOPICRUYMBTIFAIGTUKBAAUYTWMOSGQQDDN5XHIZLYOSBHQJTIOR2HA4Z2F4XXO53XFZ3TGLTPOJTS6MRQGE4C6Y3SMVSGK3TUNFQWY4ZPOYYXQKTIOR2HA4Z2F4XW46TDOAXGG33WNFSDCOJONBSWC3DUNAXG46RPMNXW45DFPB2HGL3WGFTXMZLSONUW63TFGEXDALRQMR2HS4DFQJ2FMZLSNFTGSYLCNRSUG4TFMRSW45DJMFWG6UDVMJWGSY2DN53GSZCQMFZXG4LDOJSWIZLOORUWC3CTOVRGUZLDOSRWSZ3JOZSW4TTBNVSWISTBMNVWUZTBNVUWY6KOMFWWKZ2TOBQXE4TPO5RWI33CNIYTSNRQFUYDILJRGYDVAYFE6VGU4MCDGK7DHLLYWHVPUS2YIDJOA6Y524TD3AZRM263WTY2BE4DPKIF27WKF3UDNNVSVWRDYIYVJ65IRJJJ6Z25M2DO4YZLBHWFQGVQR5ZLIWEQJOZTS3IQ7JTNCFDX";
final pass = await CovidPass.parse(code, allowTestIssuers: true);
expect(pass.givenName, "Jack");
expect(pass.familyName, "Sparrow");
expect(pass.dob, DateTime(1960, 4, 16));
});