MCPcopy Index your code
hub / github.com/coder/coder / HashSecret

Function HashSecret

coderd/apikey/apikey.go:154–157  ·  view source on GitHub ↗

HashSecret is the single function used to hash API key secrets. Use this to ensure a consistent hashing algorithm.

(secret string)

Source from the content-addressed store, hash-verified

152// HashSecret is the single function used to hash API key secrets.
153// Use this to ensure a consistent hashing algorithm.
154func HashSecret(secret string) []byte {
155 hash := sha256.Sum256([]byte(secret))
156 return hash[:]
157}

Callers 3

HashSecretFunction · 0.92
GenerateSecretFunction · 0.70
ValidateHashFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected