answer/pkg/random/random_username.go

19 lines
290 B
Go

package random
import (
"crypto/rand"
"encoding/hex"
)
func UsernameSuffix() string {
bytes := make([]byte, 2)
_, _ = rand.Read(bytes)
return hex.EncodeToString(bytes)
}
func Username() string {
bytes := make([]byte, 6)
_, _ = rand.Read(bytes)
return hex.EncodeToString(bytes)
}