Skip to content

Commit

Permalink
revert genTraceId (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Responsitories authored Feb 24, 2025
1 parent 7f912a1 commit 8d39901
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8d39901

Please sign in to comment.