mirror of
https://github.com/verssache/chatgpt-creator.git
synced 2026-05-16 21:59:33 +00:00
Initial commit: ChatGPT Account Registration Bot
This commit is contained in:
24
internal/util/helpers.go
Normal file
24
internal/util/helpers.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
// RandStr generates a random alphanumeric string of given length.
|
||||
func RandStr(length int) string {
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
b := make([]byte, length)
|
||||
for i := range b {
|
||||
b[i] = alphanumeric[r.Intn(len(alphanumeric))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
// GenerateUUID generates a random UUID.
|
||||
func GenerateUUID() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
Reference in New Issue
Block a user