chore(deps): remove direct dependency on golang.org/x/exp

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-12-31 17:02:52 -05:00
parent fc9817552d
commit 735c0d9103
4 changed files with 12 additions and 11 deletions
+2 -2
View File
@@ -5,12 +5,12 @@ import (
"encoding/binary"
"math/big"
"golang.org/x/exp/constraints"
"github.com/navidrome/navidrome/utils/number"
)
// Int64N returns a random int64 between 0 and max.
// This is a reimplementation of math/rand/v2.Int64N using a cryptographically secure random number generator.
func Int64N[T constraints.Integer](max T) int64 {
func Int64N[T number.Integer](max T) int64 {
rnd, _ := rand.Int(rand.Reader, big.NewInt(int64(max)))
return rnd.Int64()
}