Leading zero's are cut out from the decompression

62 views
Skip to first unread message

Murat Karagoez

unread,
May 27, 2022, 4:13:43 AM5/27/22
to GS1 Digital Link Developers
Hello,

first and foremost a big thank you all for providing the GS1DigitalLinkToolkit.js. With that I could develop a counterpart for Java for our own internal usage here at GoodsTag.

We are currently implementing our own solution for the GS1 DL Resolver and everything is working fine so far. But there is a issue with the decompression and leading zeros in the function handleDecodings


Example: 
Plain URL / Compressed / Decompressed

1)

2)

I attached a Minimal, Reproducible Example. 

Currently we solved it by using the value of numChars for padding the zeros. The JavaScript equivalent would look like this

let s = String(BigInt('0b' + rbv)).padStart(numChars, '0');

However I am not sure if this will produce side-effects. So could you double check if that is O.K?

Best Regards

Murat Karagöz

minimal-example.html
Reply all
Reply to author
Forward
0 new messages