passgen/dictionary/shuffle.go

15 lines
220 B
Go
Raw Normal View History

2024-03-28 13:17:50 +02:00
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
}