[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake-mobile/master] Changed int to long in SID, changed radix 64 to 36



commit 7e391ac08d261601c4490e8786951ba5d82b1f74
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Tue Jun 23 09:47:55 2020 +0530

    Changed int to long in SID, changed radix 64 to 36
---
 app/src/main/java/org/torproject/snowflake/SIDHelper.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/src/main/java/org/torproject/snowflake/SIDHelper.java b/app/src/main/java/org/torproject/snowflake/SIDHelper.java
index 1d6cb51..4c903b6 100644
--- a/app/src/main/java/org/torproject/snowflake/SIDHelper.java
+++ b/app/src/main/java/org/torproject/snowflake/SIDHelper.java
@@ -1,7 +1,5 @@
 package org.torproject.snowflake;
 
-import android.util.Log;
-
 import org.torproject.snowflake.exceptions.EmptySIDException;
 
 import java.util.Random;
@@ -30,7 +28,7 @@ public class SIDHelper {
      * @return generated sid.
      */
     public String generateSid() {
-        sid = Integer.toString(new Random().nextInt(), 64).substring(2);
+        sid = Long.toString(Math.abs(new Random().nextLong()), 36);
         return sid;
     }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits