Skip to content

Instantly share code, notes, and snippets.

@eoftedal
Last active August 29, 2015 14:19
Show Gist options
  • Save eoftedal/50a3ddd6bcc060ff2bd2 to your computer and use it in GitHub Desktop.
Save eoftedal/50a3ddd6bcc060ff2bd2 to your computer and use it in GitHub Desktop.
Crazy stuff
import java.security.SecureRandom;
import java.math.BigInteger;
public class Lottery {
private static SecureRandom random = new SecureRandom();
public static void main(String[] args) {
String lotteryNumber = new BigInteger(130, random).toString(32);
/* Used when testing \u002a\u002f
lotteryNumber = "123";
\u002f\u002a */
System.out.println("The winning number is: " + lotteryNumber);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment