* Hashes text content into a stable, Unicode-safe key. * * Uses SHA-256 over UTF-8 bytes and truncates to keep memory usage bounded.
(text: string)
| 92 | * Uses SHA-256 over UTF-8 bytes and truncates to keep memory usage bounded. |
| 93 | */ |
| 94 | function hashText(text: string): string { |
| 95 | return createHash("sha256").update(text, "utf8").digest("hex").slice(0, SIGNATURE_TEXT_HASH_HEX_LEN); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Caches a thinking signature for a given session and text. |
no test coverage detected