Revision 5, 304 bytes
(checked in by broder, 17 years ago)
|
Checksumming function to get the md5, sha1, and rmd160 checksums that usually come with Portfiles.
|
- Property svn:executable set to
*
|
Line | |
---|
1 |
#!/usr/bin/env python |
---|
2 |
|
---|
3 |
import sys |
---|
4 |
import hashlib |
---|
5 |
|
---|
6 |
for arg in sys.argv[1:]: |
---|
7 |
print "%s:" % arg |
---|
8 |
f = open(arg).read() |
---|
9 |
print "checksums\t\tmd5 %s \\" % hashlib.md5(f).hexdigest() |
---|
10 |
print "\t\t\t\tsha1 %s \\" % hashlib.sha1(f).hexdigest() |
---|
11 |
print "\t\t\t\tripemd160 %s" % hashlib.new('rmd160', f).hexdigest() |
---|