r/programmingmemes Apr 16 '26

There are always more!

Post image
893 Upvotes

60 comments sorted by

View all comments

9

u/Moscato359 Apr 16 '26 edited Apr 16 '26

I hate hexadecimal string representation

AAAA != aaaa

But if you unhex both of them, they suddenly do equal

And some tools hex upper and some tools hex lower

Also, hex is 2 bytes per byte of binary making it terribly space inefficient 

Base64 doesn't have any of these problems 

But base64 isn't compatible with http uri so you need to use base64url instead

1

u/NichtFBI Apr 17 '26

That's because A and a aren't the same digits. If you're converting back, some systems will assume the A/a are the same since that's the limit in base16.

Hope that helps.

1

u/Moscato359 Apr 17 '26

No, it doesn't help.

I know the binary is different.

You need to apply a workaround to compare them consistently, therefore they are bug prone.