15 lines
213 B
Go
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
|
|
}
|