Files
lightController/backend/utils/secret.go
2025-05-28 21:48:30 +02:00

15 lines
213 B
Go

package utils
import (
"crypto/rand"
)
func GenerateJWTSecret(length int) ([]byte, error) {
bytes := make([]byte, length)
_, err := rand.Read(bytes)
if err != nil {
return nil, err
}
return bytes, nil
}