Files
ackify/pkg/crypto/nonce.go
T
Benjamin 62f8a56c7a feat: initial project setup
Add complete Go application for cryptographic document signature validation with OAuth2 authentication, Ed25519 signatures, and PostgreSQL storage following clean architecture principles.
2025-09-10 17:10:22 +02:00

17 lines
335 B
Go

package crypto
import (
"crypto/rand"
"encoding/base64"
)
// GenerateNonce generates a cryptographically secure random nonce
func GenerateNonce() (string, error) {
nonceBytes := make([]byte, 16)
if _, err := rand.Read(nonceBytes); err != nil {
return "", err
}
return base64.RawURLEncoding.EncodeToString(nonceBytes), nil
}