mining ruby simulator

translation from
http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html
python code