MCPcopy
hub / github.com/autobrr/qui / HashAPIKey

Function HashAPIKey

internal/models/api_key.go:48–51  ·  view source on GitHub ↗

HashAPIKey creates a SHA256 hash of the API key

(key string)

Source from the content-addressed store, hash-verified

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

Callers 4

CreateMethod · 0.85
ValidateKeyMethod · 0.85
CreateMethod · 0.85
ValidateAPIKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected