Skip to content

Missing explanation #9711

Open
Open
@hexagonius

Description

@hexagonius

https://learn.microsoft.com/de-de/dotnet/api/system.random.-ctor?view=net-8.0#system-random-ctor(system-int32)

The example code uses:
(int) DateTime.Now.Ticks & 0x0000FFFF

There is no explanation why this is used. The example mentions the seeds generated might end up the same when executed too fast. Is this an example safety because Ticks changes from higher to lower bits?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.DateTimeuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions