Skip to content

Guid.Version does not return correct version in all situations #108267

@swtrse

Description

@swtrse

Description

If you generate an Guid with a Version Number that starts binary with bit 1. For Example Version 8.
The Version Property will return 1048568 instead of 8. This is because of a missing & 0xF After the shift operation

Reproduction Steps

Generate a Guid with version number set to 8.
Get the value of the Guid.Version property.

Expected behavior

Returns the correct Version number.

Actual behavior

Returns the wrong Version number

Regression?

Unknown

Known Workarounds

When combined with the bit operation & 0xF the result is correct.

Configuration

.NET9 RC2

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Runtimein-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions