From 674d3255029b7c516b470cdb451b744c97579d98 Mon Sep 17 00:00:00 2001 From: Julien Blatecky Date: Fri, 10 Dec 2021 14:18:10 +0100 Subject: [PATCH] Fix decoder for third dose --- src/decode.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/decode.ts b/src/decode.ts index ae20528..6deac5c 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -20,6 +20,10 @@ export function typedArrayToBuffer(array: Uint8Array): ArrayBuffer { } export function decodeData(data: string): Object { + if (data.startsWith('https://')) { + var url = new URL(data); + data = decodeURIComponent(url.hash.substring(1)); + } if (data.startsWith('HC1')) { data = data.substring(3); @@ -45,4 +49,4 @@ export function decodeData(data: string): Object { var decoded: Object = cbor.decode(typedArrayToBufferSliced(plaintext)); return decoded; -} \ No newline at end of file +}