mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
442 B
Java
18 lines
442 B
Java
package com.todoroo.astrid.helper;
|
|
|
|
import java.util.UUID;
|
|
|
|
public class UUIDHelper {
|
|
|
|
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() {
|
|
long uuid;
|
|
do {
|
|
uuid = UUID.randomUUID().getLeastSignificantBits() & 0x7fffffffffffffffL;
|
|
} while (uuid < MIN_UUID);
|
|
return Long.toString(uuid);
|
|
}
|
|
}
|