diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/UUIDGenerator.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/UUIDGenerator.java index 04efe742..aaf25289 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/UUIDGenerator.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/UUIDGenerator.java @@ -4,16 +4,20 @@ package com.jero.common.util; import java.net.InetAddress; /** - * + * * @Author 张代浩 * */ public class UUIDGenerator { - + private UUIDGenerator(){ + + } + + /** * 产生一个32位的UUID - * + * * @return */ @@ -21,7 +25,7 @@ public class UUIDGenerator { return new StringBuilder(32).append(format(getIP())).append( format(getJVM())).append(format(getHiTime())).append( format(getLoTime())).append(format(getCount())).toString(); - + } private static final int IP; @@ -87,9 +91,8 @@ public class UUIDGenerator { private final static int toInt(byte[] bytes) { int result = 0; for (int i = 0; i < 4; i++) { - result = (result << 8) - Byte.MIN_VALUE + (int) bytes[i]; + result = (result << 8) - (Byte.MIN_VALUE & 0xff) + bytes[i]; } return result; } - }