I have a simple script that tries to find MD5 collisions via brute force.
// Pseudo:
while (runtime < 25 seconds) {
random_hash1 = random_hash();
random_hash2 = random_hash();
if (random_hash1 == random_hash2) {
notify_user();
}
}
It's working fine itself but I only get around 8 million iterations during this 25 second window. During the run my cpu usage stays at 0-1%. I'm running on 4 cores at 3.8ghz. How can I utilize my cpu more with PHP?
If I did this with java or c++ I would instantly eat whole CPU with my while (1) loop and the iteration count would boost up a lot but I would like to do this with PHP.
PS. I know finding collision is impropable but I do it for fun.