mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
revert genTraceId (#314)
This commit is contained in:
committed by
GitHub
parent
7f912a1781
commit
8d3990124e
@@ -805,9 +805,11 @@ class Utils {
|
||||
|
||||
StringBuffer randomTraceId = StringBuffer(randomId.substring(0, 24));
|
||||
|
||||
int ts = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
|
||||
for (int i = 2; i >= 0; i--) {
|
||||
randomTraceId
|
||||
.write(random.nextInt(256).toRadixString(16).padLeft(2, '0'));
|
||||
ts >>= 8;
|
||||
randomTraceId.write((ts & 0xFF).toRadixString(16).padLeft(2, '0'));
|
||||
}
|
||||
|
||||
randomTraceId.write(randomId.substring(30, 32));
|
||||
|
||||
Reference in New Issue
Block a user