Compare commits

..

2 commits

Author SHA1 Message Date
Ada
04dad7d5af Merge pull request '♻️ Use math/rand/v2' (#28) from ada/use-rand-v2 into main
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
Reviewed-on: #28
2024-02-21 12:28:39 +00:00
Ada
36e959f5e2
♻️ Use math/rand/v2
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pull_request_closed/build Pipeline was successful
2024-02-19 00:32:27 +01:00

View file

@ -4,7 +4,7 @@ import (
"crypto/rand"
"encoding/hex"
"log"
mathrand "math/rand"
mathrand "math/rand/v2"
"strconv"
"strings"
)
@ -14,7 +14,7 @@ func GenerateUrl(length uint8) string {
listChars := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
b := make([]rune, length)
for i := range b {
b[i] = listChars[mathrand.Intn(len(listChars))]
b[i] = listChars[mathrand.IntN(len(listChars))]
}
return string(b)