Merge pull request #1765 from sochotnicky/generate-proper-uuid

Generate proper UUID strings for new tasks
pull/1768/head
Alex Baker 3 years ago committed by GitHub
commit 65e05b85b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
} }
} }

Loading…
Cancel
Save