Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.71 KB

File metadata and controls

49 lines (35 loc) · 1.71 KB

xkcdskein

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!

Instructions

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

Setting up Rake tasks

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

Running in Parallel

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!

Bugs

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.

Contribute

UMD students (or anyone else), please feel free to bugfix, increase efficiency, or whatever else, then submit a pull request!

Test

To run tests after changing code, enter:

rake

Credit & Thanks

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!

Contributors

  • Jordan Goldstein
  • Sam Rose
  • Scott Block