Created
December 5, 2016 13:16
-
-
Save behrtam/c7a625bf89a6a59f943ba6aafb8d5d0b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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