Reducing CPU Usage while using reading a file
<p>This is the idea, behind my project, playing around with the hashlib modules, when user enters a hash, all uppercase lower case combination are tried to find if a match is found, everything is fine, works great, the only problem Is with the CPU usage, which shoots upto 50%-60%.. Anyhow, is there a way to decrease the cpu usage? </p>

<p>OS: Windows</p>

<p>Part Of The Code:</p>

<pre><code>def md5(file, torev):
    with open(file) as f:
        for i in f:
            i = i.replace("\n", "")
            s = map(''.join, itertools.product(*zip(i.upper(), i.lower())))
            for k in s:
                rev = hashlib.md5(k).hexdigest()
                if rev == torev:
                   print "[+] Hash Value Found"
                   print "[+] Value: "+k
                   break
</code></pre>

<p>Thanks </p>
