Ticket #117: sha256sum.py

File sha256sum.py, 311 bytes (added by zooko, at 2007-08-20T21:11:04Z)

sha256sum.py

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