We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am experimenting with these test data:
https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/IT/2DCode/raw/1.json
But I can't get COSE from COMPRESSED, instead I get error:
"uncaught exception: Remaining bytes"
My code:
function vai() { source = document.getElementById("encoded").value; console.log("QR string=",source);
// Decode BASE45: decodedObj = decode45(source); console.log("Decoded45enc=",decodedObj.enc); console.log("Decoded45raw=",decodedObj.raw); decodedObjRawHex = arrayToHex(decodedObj.raw); console.log("decodedObjRawHex=",decodedObjRawHex); if (decodedObjRawHex == testData.COMPRESSED) { console.log("BASE45 extraction ok"); } else { console.log("BASE45 extraction FAILED"); } toProcess = decodedObj.raw; // Convert in string for debug: converted = convert(toProcess); document.getElementById("decoded").value = converted; console.log("converted to string=",converted); // Unzip the decoded: unzipped = pako.inflate(toProcess); console.log("UNZ:",unzipped); unzippedHex = arrayToHex(unzipped); console.log("unzippedHex=",unzippedHex); console.log("unzippedTest=",testData.COSE); if (unzippedHex == testData.COSE) { console.log("COSE extraction ok"); } else { console.log("COSE extraction FAILED"); } var buffer = new ArrayBuffer(unzipped.length); unzipped.map(function(value, i){buffer[i] = value}); console.log("Buffer:",buffer); var decbor = CBOR.decode(buffer); console.log(decbor);
}
function numHex(s) { var a = s.toString(16); if ((a.length % 2) > 0) { a = "0" + a; } return a; }
function arrayToHex(a) { final = ""; for (var i=0; i< a.length; i++) { final += numHex(a[i]); } return final; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am experimenting with these test data:
https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/IT/2DCode/raw/1.json
But I can't get COSE from COMPRESSED, instead I get error:
"uncaught exception: Remaining bytes"
My code:
function vai() {
source = document.getElementById("encoded").value;
console.log("QR string=",source);
}
function numHex(s) {
var a = s.toString(16);
if ((a.length % 2) > 0) {
a = "0" + a;
}
return a;
}
function arrayToHex(a) {
final = "";
for (var i=0; i< a.length; i++) {
final += numHex(a[i]);
}
return final;
}
The text was updated successfully, but these errors were encountered: