first working server

This commit is contained in:
$(pass /github/name)
2024-07-03 09:40:45 +02:00
parent 9bd8d48243
commit 6d34d99835
20 changed files with 340 additions and 128 deletions

15
internal/utils/crypto.go Normal file
View File

@@ -0,0 +1,15 @@
package utils
import (
"crypto/rand"
"encoding/base64"
)
func GenerateRandomString(length int) (string, error) {
bytes := make([]byte, length)
_, err := rand.Read(bytes)
if err != nil {
return "", err
}
return base64.URLEncoding.EncodeToString(bytes), nil
}