Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Fast base64 encoding and decoding. Parent comment
symbol_1, symbol_2, symbol_3, ptr_to_1, ptr_to_2,...
ascii85 performs better than hex simply because it's dictionary is shorter.
If you compress something with a bit more structure, like "Hamlet", you'll get this:
>>> import urllib.request,zlib,codecs,base64 >>> hamlet = urllib.request.urlopen("http://www.gutenberg.org/cache/epub/2265/pg2265.txt").read() >>> len(codecs.encode(hamlet, 'base64')) 248577 >>> len(codecs.encode(hamlet, 'hex')) 368018 >>> len(base64.a85encode(hamlet)) 230012 >>> len(zlib.compress(codecs.encode(hamlet, 'base64'))) 102788 >>> len(zlib.compress(codecs.encode(hamlet, 'hex'))) 88827 >>> len(zlib.compress(base64.a85encode(hamlet))) 121364
There are no comments on this comment yet.
symbol_1, symbol_2, symbol_3, ptr_to_1, ptr_to_2,...
ascii85 performs better than hex simply because it's dictionary is shorter.
If you compress something with a bit more structure, like "Hamlet", you'll get this: