mirror of
https://github.com/Aviortheking/advent-of-code.git
synced 2025-04-22 10:52:11 +00:00
16 lines
251 B
TypeScript
16 lines
251 B
TypeScript
import crypto from 'crypto'
|
|
|
|
|
|
// const input = "pqrstuv"
|
|
const input = "yzbqklnj"
|
|
|
|
let hash = ""
|
|
let i = 0
|
|
do {
|
|
hash = crypto.createHash('md5').update(input + ++i).digest('hex')
|
|
} while (!hash.startsWith('00000'))
|
|
|
|
|
|
console.log(
|
|
"Result:", i, hash
|
|
) |