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