Day 4: The Ideal Stocking Stuffer

Puzzle Description

Advent of Code 2015, Day 4

Full Solution Source

My Solution for 2015, Day 4

For most languages (and plain Scala, if you aren't cross compiling) today isn't really that interesting. However, it's very interesting if you are doing this for Scala.JS or Scala Native.

My Scala Native version links to openssl libcrypto. JVM uses java.security.MessageDigest, and JS rolls its own MD5 hash function.

Benchmark

Part 1

Mean

Error

JVM

65.143 ms

+/- 0.241 ms

JS

649.542 ms

+/- 32.188 ms

Native

346.239 ms

+/- 0.982 ms

Part 2

Mean

Error

JVM

1.879 s

+/- 0.181 s

Native

9.991 s

+/- 0.238 s

Run it in the browser!