Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def manual_gzip(data, cache_file=None):
_header = ("\037\213\010\000" # magic, type, flags
"\000\000\000\000" # mtime
"\002\377") # xfl, os
co = zlib.compressobj()
return ''.join([_header, co.compress(data)[2:], co.flush()])
# struct.pack("<ll",zlib.crc32(data),len(data))])

This comment has been minimized.

Copy link

hoisie commented Jun 3, 2010

Very useful stuff, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.