Skip to content

feat(shuffle)!: add Shuffle and ShuffleSlice functions #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Conversation

jimeh
Copy link
Owner

@jimeh jimeh commented Mar 10, 2025

Add equivalent to Shuffle function from math/rand and math/rand/v2 packages, but based on randomness from crypto/rand package. This allows cryptographically secure shuffling of data.

Also add ShuffleSlice function that shuffles a slice of any type.

BREAKING CHANGE: Minimum required Go version is now 1.18 due the ShuffleSlice using generics.

Add equivalent to `Shuffle` function from `math/rand` and `math/rand/v2`
packages, but based on randomness from `crypto/rand` package. This
allows cryptographically secure shuffling of data.

Also add `ShuffleSlice` function that shuffles a slice of any type.

BREAKING CHANGE: Minimum required Go version is now 1.18 due the `ShuffleSlice` using generics.
@jimeh jimeh merged commit a141938 into main Mar 10, 2025
16 checks passed
@jimeh jimeh deleted the add-shuffle branch March 10, 2025 23:50
@jimehbot jimehbot bot mentioned this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant