We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fea875 commit 4c260a8Copy full SHA for 4c260a8
google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java
@@ -18,6 +18,7 @@
18
19
import com.google.api.core.InternalApi;
20
import com.google.common.annotations.VisibleForTesting;
21
+import java.math.BigInteger;
22
import java.security.SecureRandom;
23
import java.util.Objects;
24
@@ -48,7 +49,8 @@ public static XGoogSpannerRequestId of(
48
49
50
private static String generateRandProcessId() {
51
// Expecting to use 64-bits of randomness to avoid clashes.
- return String.format("%016x", new SecureRandom().nextInt(64));
52
+ BigInteger bigInt = new BigInteger(64, new SecureRandom());
53
+ return String.format("%016x", bigInt);
54
}
55
56
@Override
0 commit comments