Added the four first days of 2015

Yes i'm gonna do them all !

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
2021-12-07 17:03:46 +01:00
parent c0369d340a
commit 1060cb8a09
11 changed files with 1179 additions and 0 deletions

16
2015/day-4/part-1.ts Normal file
View File

@@ -0,0 +1,16 @@
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
)

16
2015/day-4/part-2.ts Normal file
View File

@@ -0,0 +1,16 @@
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('000000'))
console.log(
"Result:", i, hash
)