GofileScrapper/misc/generator.go
2024-03-19 17:20:55 +01:00

21 lines
342 B
Go

package misc
import (
"math/rand"
"strings"
"time"
)
func GetRandomContent() string {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
var result strings.Builder
charsetLength := len(CHARSET)
for i := 0; i < 6; i++ {
randomIndex := r.Intn(charsetLength)
result.WriteByte(CHARSET[randomIndex])
}
return result.String()
}