修改方法名

dev
ZhouXY108 2024-10-21 01:42:01 +08:00
parent 269f9d686e
commit ab05b55b04
1 changed files with 6 additions and 6 deletions

View File

@ -40,15 +40,15 @@ public class IdGenerator {
}
public static String toSimpleString(UUID uuid) {
return (digits(uuid.getMostSignificantBits() >> 32, 8) +
digits(uuid.getMostSignificantBits() >> 16, 4) +
digits(uuid.getMostSignificantBits(), 4) +
digits(uuid.getLeastSignificantBits() >> 48, 4) +
digits(uuid.getLeastSignificantBits(), 12));
return (uuidDigits(uuid.getMostSignificantBits() >> 32, 8) +
uuidDigits(uuid.getMostSignificantBits() >> 16, 4) +
uuidDigits(uuid.getMostSignificantBits(), 4) +
uuidDigits(uuid.getLeastSignificantBits() >> 48, 4) +
uuidDigits(uuid.getLeastSignificantBits(), 12));
}
/** Returns val represented by the specified number of hex digits. */
private static String digits(long val, int digits) {
private static String uuidDigits(long val, int digits) {
long hi = 1L << (digits * 4);
return Long.toHexString(hi | (val & (hi - 1))).substring(1);
}