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 d5b9996 commit 713e274Copy full SHA for 713e274
android/src/main/java/org/linusu/RNGetRandomValuesModule.java
@@ -11,6 +11,8 @@
11
public class RNGetRandomValuesModule extends NativeRNGetRandomValuesSpec {
12
protected static final String NAME = "RNGetRandomValues";
13
14
+ private static final SecureRandom SECURE_RANDOM = new SecureRandom();
15
+
16
public RNGetRandomValuesModule(ReactApplicationContext reactContext) {
17
super(reactContext);
18
}
@@ -23,9 +25,8 @@ public String getName() {
23
25
@Override
24
26
public String getRandomBase64(double byteLength) {
27
byte[] data = new byte[(int) byteLength];
- SecureRandom random = new SecureRandom();
28
- random.nextBytes(data);
29
+ SECURE_RANDOM.nextBytes(data);
30
31
return Base64.encodeToString(data, Base64.NO_WRAP);
32
0 commit comments