mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-02-27 19:32:00 +00:00
feat: add oidc client create command
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"net"
|
||||
@@ -105,3 +106,9 @@ func GenerateUUID(str string) string {
|
||||
uuid := uuid.NewSHA1(uuid.NameSpaceURL, []byte(str))
|
||||
return uuid.String()
|
||||
}
|
||||
|
||||
func GenerateString(length int) string {
|
||||
src := make([]byte, length)
|
||||
rand.Read(src)
|
||||
return base64.RawURLEncoding.EncodeToString(src)[:length]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user