Bug 18595 – std.random: add unpredictableSeedOf!UIntType for non-uint unpredictableSeed

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-03-12T09:35:27Z
Last change time
2018-11-14T11:59:27Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-03-12T09:35:27Z
It would be convenient if `std.random.unpredictableSeed` could be used to produce `ulong`. To avoid any backwards compatibility issues I propose calling the new method `unpredictableSeedOf!UIntType` and aliasing `unpredictableSeed` to `unpredictableSeed!uint`.
Comment #1 by n8sh.secondary — 2018-03-31T03:43:22Z
Comment #2 by github-bugzilla — 2018-11-14T11:59:26Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/c75d6f712a88ddc2cca4ceed64cb2cb1fa89d1b6 Fix Issue 18595 & Issue 18596: replace MindstdRand0 w/SplitMix & templatize unpredictableSeed!UIntType https://github.com/dlang/phobos/commit/bcbbae2494becff761a2cbf1fb833b2e6ea1de17 Merge pull request #6580 from n8sh/unpredictableSeed-18595-18596 Fix Issue 18595 & Issue 18596: replace MindstdRand0 w/SplitMix & templatize unpredictableSeed!UIntType merged-on-behalf-of: Nicholas Wilson <[email protected]>