|
@@ -203,16 +203,6 @@ public class Sequence {
|
|
|
* 反解id的时间戳部分
|
|
|
*/
|
|
|
public static long parseIdTimestamp(long id) {
|
|
|
- String s = Long.toBinaryString(id);
|
|
|
- int x = 64 - s.length();
|
|
|
- StringBuilder b = new StringBuilder();
|
|
|
- for (int i = 0; i < x; i++) {
|
|
|
- b.append("0");
|
|
|
- }
|
|
|
- s = b + s;
|
|
|
- s = s.substring(1, 42);
|
|
|
- long l = Long.parseUnsignedLong(s, 2);
|
|
|
- l += twepoch;
|
|
|
- return l;
|
|
|
+ return (id>>22)+twepoch;
|
|
|
}
|
|
|
}
|