Ticket #117: adler32sum.py

File adler32sum.py, 306 bytes (added by zooko, at 2007-08-20T21:11:34Z)

adler32sum.py

Line 
1#!/usr/bin/env python
2
3# from the Python Standard Library
4import sys, zlib
5
6if __name__ == '__main__':
7    fobj = open(sys.argv[1], "r")
8    adlerval = 0
9    data = fobj.read(65536)
10    while data:
11        adlerval = zlib.adler32(data, adlerval)
12        data = fobj.read(65536)
13    print "%x" % adlerval
14