HashAPIKey creates a SHA256 hash of the API key
(key string)
| 46 | |
| 47 | // HashAPIKey creates a SHA256 hash of the API key |
| 48 | func HashAPIKey(key string) string { |
| 49 | hash := sha256.Sum256([]byte(key)) |
| 50 | return hex.EncodeToString(hash[:]) |
| 51 | } |
| 52 | |
| 53 | func (s *APIKeyStore) Create(ctx context.Context, name string) (string, *APIKey, error) { |
| 54 | // Generate new API key |
no outgoing calls
no test coverage detected