3 ms·
Am I the only one that doesn't like base 64? Hex for when efficiency isn't paramount. Base 85 or BasE91 for when efficiency is more of a concern. http://ba
by Zamicol 5y ago
Am I the only one that doesn't like base 64?
Hex for when efficiency isn't paramount.
Base 85 or BasE91 for when efficiency is more of a concern. http://base91.sourceforge.net/ http://base91.sourceforge.net/
- Aeolun 5y agoI like base64 because it’s the de-facto standard, and data size (in places where I’d use base64) isn’t a main concern for me.
- stjohnswarts 5y agoYeah I get tired of reinvention of everything for tiny gains in size/performance.
- hackcasual 5y agoYou want to use hex whenever byte aligned data is going to be compressed. Base64 quadruples byte level symbols
- ralusek 5y agoI understand the case for Base91, but why hex over Base64? Base64 for readability and sticking to multiples of two, Base91 for maximum efficiency with readable ASCII.
- Zamicol 5y agoBase 64 is good at nothing and bad at some things. - Hex is human readable, case insensitive, not that "inefficient", and always aligns to bytes. - Base 85 and basE91 are efficient. - Bitcoin uses Base58 because they thought base 64 was too human unreadable. Ethereum uses Hex. - Base 256 (bytes) is efficient and the native language of computers. Base 64 is not efficient, not human readable, and not easy to encode. The biggest problem with base 64 is that base 64 is not base 64. Are you doing base 64 with padding? Are you doing base 64 with URL safe characters or URL unsafe characters? Are you following the standard RFC 4648 bucket encoding, or are you using iterative divide by radix? I think a great place where the cracks show is JOSE, where for things like thumbprints there's a ton of conversion steps (UTF-8 key -> base 64 -> ASCII bytes -> digest (bytes) -> base 64 thumbprint). My personal advise for 90% of projects considering looking at base 64 should just use Hex or bytes. If needing human readability, use Hex. Otherwise use binary.