|
|
@ -3,15 +3,8 @@ package com.todoroo.astrid.helper;
|
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
|
|
public class UUIDHelper {
|
|
|
|
public class UUIDHelper {
|
|
|
|
|
|
|
|
/** @return a newly generated uuid */
|
|
|
|
private static final long MIN_UUID = 100000000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @return a pair consisting of the newly generated uuid and the corresponding proof text */
|
|
|
|
|
|
|
|
public static String newUUID() {
|
|
|
|
public static String newUUID() {
|
|
|
|
long uuid;
|
|
|
|
return UUID.randomUUID().toString();
|
|
|
|
do {
|
|
|
|
|
|
|
|
uuid = UUID.randomUUID().getLeastSignificantBits() & 0x7fffffffffffffffL;
|
|
|
|
|
|
|
|
} while (uuid < MIN_UUID);
|
|
|
|
|
|
|
|
return Long.toString(uuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|