weightedrand icon indicating copy to clipboard operation
weightedrand copied to clipboard

Feature: Utilize math/rand/v2

Open robinjoseph08 opened this issue 1 year ago • 2 comments

Since Go v1.22, they added a new version of the rand package (more details in this post) that should be faster if nothing else. It would be nice to see how things compare using that.

robinjoseph08 avatar Sep 10 '24 14:09 robinjoseph08

@robinjoseph08 this is implemented in #36 for a v3 release, I just need some feedback/iteration on the API changes. Please take a look and let me know what you think!

mroth avatar Sep 10 '24 15:09 mroth

Any particular reason the Math version was chosen instead of the Crypto version?

In the past I have used a mixed approach.

If I wanted true randomness I would choose the Crypto version. But in cases where I need just random but with the predictability of getting the same random sequence for any given seed, then I would choose Math.

A use case for my latter option (Math) was when I needed to create "Grundstellung" day-of-the-month tables for an Enigma encryption package.

lordofscripts avatar Sep 11 '25 15:09 lordofscripts