Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 343cbd0

Browse files
committed
Use 2.1's .hexdigest() method
1 parent 2ee4be0 commit 343cbd0

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Tools/scripts/md5sum.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
"""Python utility to print MD5 checksums of argument files.
44
5-
Works with Python 1.5.2 and later.
5+
Works with Python 2.1 and later.
66
"""
77

88
import sys, md5
99

1010
BLOCKSIZE = 1024*1024
1111

12-
def hexify(s):
13-
return ("%02x"*len(s)) % tuple(map(ord, s))
14-
1512
def main():
1613
args = sys.argv[1:]
1714
if not args:
@@ -26,7 +23,7 @@ def main():
2623
break
2724
sum.update(block)
2825
f.close()
29-
print hexify(sum.digest()), file
26+
print sum.hexdigest(), file
3027

3128
if __name__ == "__main__":
3229
main()

0 commit comments

Comments
 (0)