|
@@ -835,4 +835,16 @@ public final class StringUtil {
|
|
|
}
|
|
|
return str.toString();
|
|
|
}
|
|
|
+
|
|
|
+ public static Long guidToId(String guid) {
|
|
|
+ String str = StringUtil.toHexString(guid).toUpperCase()
|
|
|
+ .replaceAll("A", "10")
|
|
|
+ .replaceAll("B", "11")
|
|
|
+ .replaceAll("C", "12")
|
|
|
+ .replaceAll("D", "13")
|
|
|
+ .replaceAll("E", "14")
|
|
|
+ .replaceAll("F", "15");
|
|
|
+ int idx = str.length() - 16;
|
|
|
+ return Long.parseLong(str.substring(idx, idx + 15) + StringUtil.splitList(str, 1).stream().mapToLong(Long::parseLong).sum());
|
|
|
+ }
|
|
|
}
|