import time
from bitcoin.core import x, b2x
start = time.time()
count = 1
if __name__ == '__main__':
h1 = scrypt.hash(str(time.time()), 'random salt', 32768, 8, 1, 16)
while 1:
h1 = scrypt.hash(h1, 'random salt', 32768, 8, 1, 16)
count += 1
if h1 < x('04ffffffffffffffffffffffffffffff'):
print(b2x(h1), time.time() - start, count)
('0054d812ff175cbe77652ecbf2a9bb89', 2.9400529861450195, 29)
('001a28b31c37f50dc28ff98c98823cdf', 8.692596912384033, 85)
('0413606381ecb582ef1557484d8e00fc', 9.584491968154907, 94)
('00859f4ed4cd3f3e741a8662e6286cc1', 16.008608102798462, 156)
('03834f8386fd6d84ed1f28f3e509e2d1', 19.082252979278564, 187)
('011061508daa0a82c6484090142ef9de', 20.083352088928223, 197)
('01617152783622a3b8fa0f2098344d6a', 28.243431091308594, 275)
('018c126d001906ddeaaf3af9622947b8', 75.0232720375061, 728)