fix(TDI-42192): Use SecureRandom in system routines (#2707)

This commit is contained in:
wang wei
2019-09-18 18:34:00 +08:00
committed by wwang-talend
parent fed21693cc
commit 0bc770463c
5 changed files with 31 additions and 9 deletions

View File

@@ -7,6 +7,8 @@ package routines;
import java.math.BigDecimal;
import routines.system.RandomUtils;
public class Numeric {
private static final java.util.Map<String, Integer> seq_Hash = new java.util.HashMap<String, Integer>();
@@ -94,7 +96,7 @@ public class Numeric {
if (max < min) {
throw new RuntimeException("Max value should be bigger than min value");
}
return ((Long) Math.round(min - 0.5 + (Math.random() * (max - min + 1)))).intValue();
return ((Long) Math.round(min - 0.5 + (RandomUtils.random() * (max - min + 1)))).intValue();
}
/**