Alpha version be update

This commit is contained in:
Jesse Malotaux 2025-04-17 11:20:27 +02:00
parent f5f6f25a4a
commit e1b13b3930
12 changed files with 86 additions and 42 deletions

View file

@ -7,9 +7,7 @@ import (
"crypto/rand"
"encoding/base64"
"errors"
"math"
mathRand "math/rand"
"strconv"
"strings"
)
@ -75,10 +73,11 @@ func GenerateRandomString(length int) string {
}
func GenerateRandomIntegerString(length int) string {
min := int64(0)
max := int64(math.Pow10(length))
randInt := min + mathRand.Int63()%(max-min+1)
return strconv.FormatInt(randInt, 10)
var sb strings.Builder
for i := 0; i < length; i++ {
sb.WriteByte('0' + byte(mathRand.Intn(10)))
}
return sb.String()
}
func GenerateKey() string {