passgen/dictionary/shuffle.go
2024-03-28 13:17:50 +02:00

15 lines
220 B
Go

package dictionary
import (
"math/rand/v2"
)
func ShuffleDictionarySet(slice []int) []int {
for i := len(slice) - 1; i > 0; i-- {
j := rand.IntN(i + 1)
slice[i], slice[j] = slice[j], slice[i]
}
return slice
}