Home Python - Loop stops running after a short while
Reply: 0

Python - Loop stops running after a short while

user476
1#
user476 Published in April 26, 2018, 5:22 pm

So here I'm generating random hex values, hashing them and comparing to a pre-given hash. The program tests about 4 000 hashes and then just stops running without an error.

Here's the loop part of the code:

def loop():

    randomhex = binascii.b2a_hex(os.urandom(4))
    hash_object = hashlib.sha1(randomhex)
    hashh = hash_object.hexdigest()
    print(hashh)

    if hashh == sha:
        done()
    else:
        loop()
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305425 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO