package code.kalter.longflight.crypto; /** * Простой Генератор Псевдослучайных Чисел * * @author KalterFive */ public class Random { private int next; public Random(int next) { this.next = next; } public Random() { this((int) System.currentTimeMillis()); } public int random() { next ^= (next << 13); next ^= (next >>> 17); next ^= (next << 5); return Math.abs(next); } // random от [0] до [max - 1] public int random(int max) { return random() % max; } }