Bug 19138 – std.uuid.randomUUID should not depend on std.random.Random being Mt19937

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-08-03T15:18:18Z
Last change time
2018-08-13T18:18:08Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-08-03T15:18:18Z
Right now `std.uuid` has a static assert that `std.random.Random` is `Mt19937`. This is contrary to the public documentation of `std.random.Random`: --- The "default", "favorite", "suggested" random number generator type on the current platform. It is an alias for one of the previously-defined generators. You may want to use it if (1) you need to generate some nice random numbers, and (2) you don't care for the minutiae of the method being used. --- Depending on implementation details of another module is brittle and may lead others to believe they can make the same assumption if even other Phobos modules assumes it.
Comment #1 by n8sh.secondary — 2018-08-03T16:17:25Z
Comment #2 by github-bugzilla — 2018-08-13T18:18:07Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/202a837b7d0afeee740342137aeeb3dd44e9c53d Fix Issue 19138 - std.uuid.randomUUID should not depend on std.random.Random being Mt19937 https://github.com/dlang/phobos/commit/4f47af9dd649728e54f850d264584e9db13af191 Merge pull request #6653 from n8sh/issue-19138 Fix Issue 19138 - std.uuid.randomUUID should not depend on std.random.Random being Mt19937