📜  16 位 atm 随机卡号 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:56.134000             🧑  作者: Mango

代码示例1
//Declare this before you need to use it
java.util.Random rng = new java.util.Random(); //Provide a seed if you want the same ones every time
...
//Then, when you need a number:
long first14 = (rng.nextLong() % 100000000000000L) + 5200000000000000L;
//Or, to mimic the Math.random() option
long first14 = (rng.nextDouble() * 100000000000000L) + 5200000000000000L;