Skip to content

Instantly share code, notes, and snippets.

@t3h2mas
Created November 20, 2016 00:44
Show Gist options
  • Save t3h2mas/b7081791f167cca52b894c3763738658 to your computer and use it in GitHub Desktop.
Save t3h2mas/b7081791f167cca52b894c3763738658 to your computer and use it in GitHub Desktop.
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