Created
November 20, 2016 00:44
-
-
Save t3h2mas/b7081791f167cca52b894c3763738658 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
const crypto = require('crypto') | |
const searchStr = process.argv[2] || 'deadbeef' | |
const start = process.argv[3] || 42 | |
const hasher = function *() { | |
let acc = start | |
while (true) { | |
yield [crypto | |
.createHash('md5') | |
.update(acc.toString()) | |
.digest('hex'), acc] | |
acc++ | |
} | |
} | |
const gen = hasher() | |
let run = true | |
while (run) { | |
let hash = gen.next().value | |
if (hash[1] % 100000 === 0) console.log(hash[1]) | |
if (hash[0].indexOf(searchStr) === -1) continue | |
run = false | |
console.log(hash) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment