DEADSOFTWARE
GIT
/
REPO
/
FRED-BOY
Projects
/
LongFlight.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Initial commit.
[LongFlight.git]
/
Crypto
/
src
/
code
/
kalter
/
longflight
/
crypto
/
Random.java
1
package
code
.
kalter
.
longflight
.
crypto
;
2
3
/**
4
* ГПСЧ
5
*
6
* @author Kalter
7
*/
8
public class
Random
{
9
10
private int
next
;
11
12
public
Random
(
int
next
) {
13
this
.
next
=
next
;
14
}
15
16
public int
random
() {
17
next ^
= (
next
<<
13
);
18
next ^
= (
next
>>>
17
);
19
next ^
= (
next
<<
5
);
20
return
Math
.
abs
(
next
);
21
}
22
23
public int
random
(
int
max
) {
24
return
random
() %
max
;
25
}
26
}