Created
November 30, 2014 17:09
-
-
Save noonien/d92556183a07c1b5f180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import hashlib | |
from datetime import datetime | |
t = datetime.now() | |
ci = 0 | |
for i in xrange(0, 2**42): | |
buf = struct.pack('Q', i) | |
m = hashlib.sha256() | |
m.update(buf) | |
m.digest() | |
tn = datetime.now() | |
dt = tn -t | |
if dt.seconds >= 5: | |
print '%.3f KHashes/sec' % ((i - ci) / 5. / 10**3) | |
ci = i | |
t = tn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment