Generates random strings, then runs them through a Skein 1024 1024 hash, and tests the number of bits correct vs. Randall's current hash at almamater.xkcd.com. The comparison hash value is currently hardcoded, not scraped, so if it changes, you'll need to pull the repo again!
Clone this repo, then run:
bin/main
If the lowest number of wrong bits is lower than umd's current record at almamater.xkcd.com/best.csv, then you should go submit the input string, at almamater.xkcd.com/?edu=umd.edu
If you'd like to use the rake utility for running in parallel, or running tests, you'll need to setup the gems. Assuming you have bundler:
bundle install
To run 4 instances in parallel for more number generation, run:
rake parallel
Because multiple instances of the program output in parallel, the lowest output may not be the lower number of wrong bits. Check up a few results!
The count of wrong bits will occasionally be off by a bit or two. Currently debugging. Seems to only occur very, very rarely. Perhaps only for strings input strings less than 8 in length, which have been removed.
UMD students (or anyone else), please feel free to bugfix, increase efficiency, or whatever else, then submit a pull request!
To run tests after changing code, enter:
rake
Thank you to www.coderslagoon.com for the SkeinR library for Skein hashing in Ruby! Also, thank you to Brian Kernighan for the bit counting algorithm!
- Jordan Goldstein
- Sam Rose
- Scott Block