Skip to content

Commit 85a7e6d

Browse files
committed
make my own UUID
1 parent 0f57873 commit 85a7e6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/net/sharksystem/asap/ASAP.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public static int previousEra(int workingEra) {
2626
*/
2727
public static String createUniqueID() {
2828
long now = System.currentTimeMillis();
29+
long nowUnchanged = now;
2930

3031
/* now is a 64 bit value. Actually, only 63 bits are relevant because it is positive value.
3132
Moreover, we are already in the 21. century - could reduce bit even more. We ignore that obvious fact
@@ -64,7 +65,7 @@ public static String createUniqueID() {
6465
i = timeDigits;
6566

6667
// random digits
67-
long rValue = now + rest;
68+
long rValue = now + nowUnchanged;
6869
Random random = new Random(rValue);
6970
for(int j = 0; j < randomDigits; j++) {
7071
int r = random.nextInt(basis);

0 commit comments

Comments
 (0)