MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / getKeyPrefix

Function getKeyPrefix

database/api_key.go:38–43  ·  view source on GitHub ↗

getKeyPrefix extracts the first 16 characters of the key for efficient lookup.

(key string)

Source from the content-addressed store, hash-verified

36
37// getKeyPrefix extracts the first 16 characters of the key for efficient lookup.
38func getKeyPrefix(key string) string {
39 if len(key) >= 16 {
40 return key[:16]
41 }
42 return key
43}
44
45// getAPIKeyCacheKey generates a cache key for an API key lookup
46// Uses the hashed key to ensure consistent cache keys

Callers 5

CreateAPIKeyMethod · 0.85
GetAPIKeyMethod · 0.85
TestGetAPIKey_SuccessFunction · 0.85
TestGetAPIKey_NotFoundFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestGetAPIKey_SuccessFunction · 0.68
TestGetAPIKey_NotFoundFunction · 0.68