Skip to content

Instantly share code, notes, and snippets.

@behrtam
Created December 5, 2016 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save behrtam/c7a625bf89a6a59f943ba6aafb8d5d0b to your computer and use it in GitHub Desktop.
Save behrtam/c7a625bf89a6a59f943ba6aafb8d5d0b to your computer and use it in GitHub Desktop.
const md5 = require('md5')
let door_id = 'ugkcyxxp'
let password = '--------'.split``
let index = 0
let found = 0
while (found < 8) {
let hash = md5(`${door_id}${index}`)
if (hash.startsWith('00000')) {
let pos = +hash[5]
if (pos >= 0 && pos < 8 && password[pos] === '-') {
password[pos] = hash[6]
found++
}
}
index++
}
console.log(password.join``)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment