Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait, why are they using 45 characters to encode 16 bits when you only need 41?

Especially when they could have avoided % and space.



Well, tbh, I don't know the reason, I can only speculate. It is meant to encode pure binary data (cbor) and not to be human readable or URI or anything like that. It is specifically designed for QR Codes. I read through some Github issue [1] just now and as far as I can tell, it is more or less a design oversight, which might be remedied by a later version.

[1]: https://github.com/ehn-dcc-development/hcert-spec/issues/64


> It is meant to encode pure binary data (cbor) and not to be human readable or URI or anything like that.

Well the reason to care is to avoid QR decoder quirkiness, otherwise you should probably just use the binary encoding.

> I read through some Github issue [1]

According to a comment near they end they were originally going to try to pack everything as a single base 45 bignum, so that half explains it. But not why they'd stick with 45 characters when changing that.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: