Skip to content

Commit f05f25b

Browse files
nohwndCopilot
andauthored
Clarify how to interpret the Variant value on Guid. (dotnet#118987)
* Clarify how to interpret the Variant value on Guid. The original description makes it hard to understand when you are not already an expert, and don't know that "don't care" bits are a term used in the linked specification. * Update src/libraries/System.Private.CoreLib/src/System/Guid.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use the proposed wording --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0eec0be commit f05f25b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • src/libraries/System.Private.CoreLib/src/System

src/libraries/System.Private.CoreLib/src/System/Guid.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ public Guid(string g)
276276

277277
/// <summary>Gets the value of the variant field for the <see cref="Guid" />.</summary>
278278
/// <remarks>
279-
/// <para>This corresponds to the most significant 4 bits of the 8th byte: 00000000-0000-0000-F000-000000000000. The "don't-care" bits are not masked out.</para>
280-
/// <para>See RFC 9562 for more information on how to interpret this value.</para>
279+
/// <para>This returns all 4 bits as is, some users may only care about fewer bits of the variant field and should refer to RFC 9562 for how to interpret the result.</para>
280+
/// <para>For example, UUIDv7 may only want to consider the 2 most significant bits of the field as the least 2 significant bits are documented as "don't-care".</para>
281281
/// </remarks>
282282
public int Variant => _d >> 4;
283283

0 commit comments

Comments
 (0)