fix():格式规范修改
parent
e24bd88c16
commit
c35dbc58eb
|
@ -82,7 +82,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||||
* @return 随机生成的 {@code UUID}
|
* @return 随机生成的 {@code UUID}
|
||||||
*/
|
*/
|
||||||
public static UUID randomUuid(boolean isSecure) {
|
public static UUID randomUuid(boolean isSecure) {
|
||||||
final Random ng = isSecure ? Holder.numberGenerator : getRandom();
|
final Random ng = isSecure ? Holder.NUMBER_GENERATOR : getRandom();
|
||||||
|
|
||||||
byte[] randomBytes = new byte[16];
|
byte[] randomBytes = new byte[16];
|
||||||
ng.nextBytes(randomBytes);
|
ng.nextBytes(randomBytes);
|
||||||
|
@ -453,6 +453,6 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||||
* SecureRandom 的单例
|
* SecureRandom 的单例
|
||||||
*/
|
*/
|
||||||
private static class Holder {
|
private static class Holder {
|
||||||
static final SecureRandom numberGenerator = getSecureRandom();
|
static final SecureRandom NUMBER_GENERATOR = getSecureRandom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue