From 4abc018d7c4a2a75ebbebf5f8fe5da870f980212 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Fri, 19 Dec 2025 19:08:56 +0200 Subject: [PATCH] upgraded to math/rand/v2 --- tools/security/random.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/security/random.go b/tools/security/random.go index cc00a2dc..b931c841 100644 --- a/tools/security/random.go +++ b/tools/security/random.go @@ -3,7 +3,7 @@ package security import ( cryptoRand "crypto/rand" "math/big" - mathRand "math/rand" // @todo replace with rand/v2? + mathRand "math/rand/v2" ) const defaultRandomAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" @@ -52,7 +52,7 @@ func PseudorandomStringWithAlphabet(length int, alphabet string) string { max := len(alphabet) for i := range b { - b[i] = alphabet[mathRand.Intn(max)] + b[i] = alphabet[mathRand.IntN(max)] } return string(b)