From 7175865a12529b5f46a897882c0b63eb2321fc15 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 21 Sep 2012 15:09:50 -0700 Subject: [PATCH] UUID proof text should make random strings using hex digits --- astrid/src/com/todoroo/astrid/helper/UUIDHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/helper/UUIDHelper.java b/astrid/src/com/todoroo/astrid/helper/UUIDHelper.java index a73dd5b2b..9b105cfe0 100644 --- a/astrid/src/com/todoroo/astrid/helper/UUIDHelper.java +++ b/astrid/src/com/todoroo/astrid/helper/UUIDHelper.java @@ -43,8 +43,11 @@ public class UUIDHelper { long uuid = 0; String proofText = ""; //$NON-NLS-1$ do { - byte[] chars = new byte[40]; - RANDOM.nextBytes(chars); + String hexDigits = "0123456789abcdef"; //$NON-NLS-1$ + char[] chars = new char[80]; + for (int i = 0; i < chars.length; i++) { + chars[i] = hexDigits.charAt(RANDOM.nextInt(hexDigits.length())); + } String s = new String(chars); String d = getDeviceId();