HashContent returns a SHA256 hash of the content as a hex string. This is useful for hashing sensitive content like prompts for telemetry.
(content string)
| 1127 | // HashContent returns a SHA256 hash of the content as a hex string. |
| 1128 | // This is useful for hashing sensitive content like prompts for telemetry. |
| 1129 | func HashContent(content string) string { |
| 1130 | return fmt.Sprintf("%x", sha256.Sum256([]byte(content))) |
| 1131 | } |
| 1132 | |
| 1133 | // ConvertAPIKey anonymizes an API key. |
| 1134 | func ConvertAPIKey(apiKey database.APIKey) APIKey { |
no outgoing calls