Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

UUID generator's v7 batch comes out in random order instead of time order

Đang mở
#316 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@omisha123 đang làm issue này rồi.

Từ ngày 23/10/2026.

  • #328 của @omisha123 — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug good first issue hacktoberfest

Pick UUID v7 in the UUID generator, set the quantity to 5 and click Generate. They're usually made in the same millisecond, so they share the timestamp prefix, and everything after it is random. The list comes out in random order. The tool calls v7 "time-ordered", and RFC 9562 (section 6.2) asks that UUIDs generated in a batch keep their creation order too.

generate (app/(tools)/uuid-generator/UuidGeneratorClient.tsx, lines 84 to 105) calls uuidV7(Date.now(), random) for each UUID and shows them as they come.

What to do

  • Keep a v7 batch in ascending order. Sorting the batch before setGenerated is enough. A counter in the bits after the timestamp (method 1 in RFC 9562, section 6.2) is the stricter option, if you'd rather do that.

Where to look

  • app/(tools)/uuid-generator/UuidGeneratorClient.tsx: generate (lines 84 to 105)
  • app/(tools)/uuid-generator/UuidGeneratorClient.test.tsx. Careful: its getRandomValues mock (lines 20 to 24) fills each UUID with a bigger value than the last, so a test that uses it passes even without the fix. Fix Date.now to one value and make the random bytes go down from one UUID to the next.

Acceptance criteria

  • A v7 batch is in ascending order, even when every UUID has the same millisecond
  • v4 batches work as before
  • A test that fails on the current code
  • npm run lint, npm run test and npm run build pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #316 in the description.

Ngôn ngữ chính
TypeScript
Star
1
Fork
9
Merge trung bình
7 giờ 34 phút
Pull request đã merge (30 ngày)
146

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codercops/toolbelt

Tất cả issue của codercops/toolbelt

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.