Chuyển tới nội dung
Number Buffet

UUID

UUID v4 và v7 lặp lại được với số lượng bất kỳ, ở dạng chuẩn, có ngoặc nhọn, URN hay dạng gọn — có hạt giống, nên liên kết chia sẻ luôn hiện cùng danh sách.

Đọc 3 phút

Thiết lập

Thiết lập nhanh

Each UUID is 36 characters in the canonical form.

Version 4 is pure randomness. Version 7 puts a millisecond timestamp in the leading 48 bits so the text form sorts by creation time.

UTC, ISO 8601. Taken as a parameter rather than read from the clock so output stays reproducible. Ignored for version 4.

Uses the 12-bit rand_a field as an incrementing counter, so UUIDs sharing one millisecond still sort in generation order. RFC 9562 sanctions this.

Change the seed for a different list. The same seed always gives the same UUIDs.

Tinh chỉnh dáng vẻ

Hãy chọn một thiết lập cạnh ảnh trước — các điều khiển này điều chỉnh nó.

Frame

A border drawn inside the edge of the image.

Nâng cao

Kết quả

10 giá trị

10edcd13-afe9-4758-891b-8df71747f52d, e849a06e-1253-4b69-afc6-07b2b83ab406, f62f0203-6e54-4ed4-a0ef-8bec5a004d3b, 8346ec30-7d1b-4ed8-8215-964d74b5c77d, fbf1ff1f-e295-4db5-b394-c4e1cfe24f3e, dcdcafc9-1445-46f0-9b6a-20ef183b5e24, 4238fd63-481c-4118-8a15-0ca4f1417c3d, b01068a0-2ba3-4765-807c-92f4cc74e3c1, 9f43791e-5f85-420c-aa6c-972b3f7b956c, 9c21e7a1-2658-4328-b10b-9e79b1684d2a

Version 4: 122 of the 128 bits are random, the other 6 carry the version and variant — which is why the 13th hex digit is always 4 and the 17th is always 8, 9, a or b. These UUIDs come from a seeded, non-cryptographic PRNG, so the same seed always returns the same list — that is what makes a shared link reproducible, and exactly why they must never be used as real identifiers. For production, call crypto.randomUUID().


Tạo ảnh

Hãy bật JavaScript để tạo kiểu cho những số này và tải về dưới dạng ảnh. Bản thân các giá trị đã được liệt kê ở trên.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

Bài viết nền bên dưới chưa được dịch và đang hiển thị bằng tiếng Anh.

Về uuid

The format predates the web. In the early 1980s Apollo Computer needed identifiers that any machine on a network could mint without asking a central authority, and built 64-bit unique IDs into its Domain/OS. The idea moved into Apollo's Network Computing System, widened to 128 bits, and from there into the Open Software Foundation's Distributed Computing Environment RPC specification at the start of the 1990s. Microsoft adopted the DCE design for COM and called the result a GUID — the same sixteen bytes, but historically printed with the first three fields byte-swapped, which is why one identifier can appear in two different spellings.

Paul Leach, Michael Mealling and Rich Salz finally wrote the format down for the IETF in July 2005 as RFC 4122, which registered the urn:uuid namespace and defined five versions: time-and-MAC (1), DCE Security (2), MD5 name-based (3), random (4) and SHA-1 name-based (5). ISO and the ITU standardised the same object as ISO/IEC 9834-8 and ITU-T X.667. Version 1's embedded MAC address turned out to be a privacy leak — GUIDs written into Microsoft Office documents carried the author's network card address, and this is widely reported to have helped investigators identify the author of the 1999 Melissa macro virus, though the accounts are second-hand.

Version 4 won on simplicity and then lost on database performance: random keys scatter inserts across a B-tree index instead of landing at its right-hand edge. Developers built time-ordered alternatives of their own — MongoDB's ObjectId in 2009, Twitter's Snowflake in 2010, Alizain Feerasta's ULID in 2016. A draft by Brad Peabody and Kyzer Davis folded that lesson back into the standard, and in May 2024 RFC 9562 replaced RFC 4122, adding version 6, version 7 (48 bits of Unix milliseconds followed by randomness, so the lowercase text form sorts by creation time) and version 8 for custom layouts.

Tính chất chính

  • The canonical text form is 36 characters: 32 hexadecimal digits in groups of 8-4-4-4-12 separated by four hyphens.
  • A version 4 UUID carries 122 random bits — 128 minus 4 version bits and 2 variant bits — giving 2^122 ≈ 5.3 × 10^36 possible values.
  • The version is the first hex digit of the third group; the variant occupies the top bits of the first hex digit of the fourth group, which for RFC 4122 and RFC 9562 UUIDs is 8, 9, a or b.
  • Drawing 103 trillion random version 4 UUIDs gives roughly a one-in-a-billion chance that two of them are identical, by the birthday approximation n²/2N.
  • A version 7 UUID begins with a 48-bit big-endian count of milliseconds since the Unix epoch, so sorting the lowercase text form sorts by creation time.
  • The nil UUID is all 128 bits zero; RFC 9562 also defines a Max UUID with all 128 bits set.
  • RFC 9562 (May 2024) obsoletes RFC 4122 (July 2005) and adds versions 6, 7 and 8 to the original five.
  • The UUIDs on this page are produced by a seeded, non-cryptographic PRNG and are reproducible by anyone with the link, so they are deliberately unsuitable as real identifiers.

Xuất hiện ở đâu

  • Windows stores COM class and interface identifiers as braced GUIDs in the registry, which is where the {8-4-4-4-12} spelling comes from.
  • Linux labels filesystems by UUID — the identifiers in /etc/fstab and the GPT partition table — so disks can be mounted regardless of the order the kernel enumerated them in.
  • Databases use UUIDs as primary keys when many clients must mint identifiers without coordinating; version 7 exists mainly because its time ordering keeps B-tree inserts near the right-hand edge of the index.
  • Distributed tracing systems use UUIDs as request and span identifiers so that log lines from different services can be stitched back together.
  • Apple exposes UUIDs through NSUUID and uses one as the identifier-for-vendor that an app sees in place of a device serial number.
  • A version 4 UUID is only as unique as the random source behind it: libraries that have backed one with a weak or predictable generator have produced real collisions, which is a property of the implementation rather than of the format.

Cách dùng bộ tạo này

Các giá trị được tạo hiện ở trên cùng, bên cạnh là nút sao chép. Để biến chúng thành ảnh, hãy chọn một dáng vẻ trong các kiểu ở phần Tạo ảnh, chọn kích thước xuất rồi tải về dưới dạng PNG, JPEG hoặc WebP. Mọi thứ được vẽ trong trình duyệt, nên không có gì bạn tạo ra được gửi tới máy chủ.

Thanh địa chỉ cập nhật theo lúc bạn làm, nên liên kết luôn cho lại đúng những gì bạn đang thấy — tiện khi muốn chia sẻ một dãy cụ thể hay giữ lại một cấu hình. Dùng Sao chép để lấy giá trị dưới dạng văn bản thuần, hoặc Xuất dữ liệu để có CSV, JSON, NDJSON, SQL và XML.

Nguồn

Các phần tóm lược lịch sử trên trang này dựa vào những tài liệu giấy phép mở được liệt kê ở trên. Thấy chỗ nào sai? Hãy cho chúng tôi biết và chúng tôi sẽ sửa.