Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

yegct/fakelotto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This shows how weak Ruby’s random number generator is.

Fire up the rails server and point your browser to: localhost:3000/lottos This generates six random lotto numbers between 1 and 49.

Now, gather at least eight sets of numbers using the following command, at least eight times: curl localhost:3000/lottos >> gathered.txt

Grab untwister from github.com/altf4/untwister and compile and run it: ./untwister -i ../fakelotto/gathered.txt -m 1 -M 50 -r ruby-rand

This will determine the seed. Run a rake task with the determined seed, and see a set of twenty lotto picks: bundle exec rake tasks:attack

Buy those lotto tickets. Win! Not really. But if you point your browser back to: localhost:3000/lottos you’ll see one of those sets of numbers show up.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published