Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #
- # Note
- # If you want to run this on your system you
- # may have to add more cycles to the inner
- # loop or work with a larger amount of data.
- # Credit for this code goes to the book
- # from Oreilly "Python Standard Library..."
- import hashlib
- import time
- # Data to use to calculate md5 checksums
- data = open(__file__, 'rt').read()
- for i in range(5):
- h = hashlib.sha1()
- print time.ctime(), ': %0.3f %0.3f' % (time.time(),
- time.clock())
- for i in range(300000):
- h.update(data)
- cksum = h.digest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement