I've noticed many websites, especially gambling, or chance related, needing transparent random number generations. Some have taken to MD5 hashes, etc. but I'd like to offer another method.
Each day, there will be 40,000 new numbers added to a list of numbers I have downloaded from random.org. The way my system works is this:
1. You send a GET request to
http://testingzone.zapto.org/random/2. You will receive a JSON output, similar to this: {"id":"3","number":"556194503","password":"4dfbaa53d6e28","time":1308338771,"error":0}
3. Check that the error is 0.
4. The ID you give to the user, the number you use, and you have the option to give the time to the user.
5. When everything has been done, you give the user the password.
Errors are as follows:
1 - Database error.
2 - Error generating numbers (ran out.)
On the user's side, it works like this:
1. You go to
http://testingzone.zapto.org/random/?act=view&id=32. You will receive an output similar to this: Number generated at 06/17/2011 07:26:11 UTC. This hopefully lets you know that the owner of the website isn't reusing old IDs.
3. When you are given the password, you add &password=4dfbaa53d6e28 to the end of the URL (so,
http://testingzone.zapto.org/random/?act=view&id=3&password=4dfbaa53d6e28)
4. You will receive an output similar to this: Number generated at 06/17/2011 07:26:11 UTC. Correct password given. The number was: 556194503
5. You verify the number is correct with the way the system works, and are satisfied.
The numbers are between the length of 1 and 1,000,000,000. It is up to you as a developer to turn that number into what you need.
The format of the time variable is an integer number of 10 digits. It's the UNIX Epoch time.
The numbers come from random.org.
Feel free to use this however you wish, just please don't try to eat up all of my numbers (i.e. don't be a douche.)
Any suggestions?
If you'd like to donate:
1a23UGMAVM6MtF31pBZNCaWgEWyBT32vS~lulzplzkthx