(body: string)
| 14 | } |
| 15 | |
| 16 | export async function computeCch(body: string): Promise<string> { |
| 17 | const hasher = await getHasher() |
| 18 | const hash = hasher.h64Raw(new TextEncoder().encode(body), CCH_SEED) |
| 19 | return (hash & CCH_MASK).toString(16).padStart(5, '0') |
| 20 | } |
| 21 | |
| 22 | export function replaceCchPlaceholder(body: string, cch: string): string { |
| 23 | return body.replace(CCH_PLACEHOLDER, `cch=${cch}`) |
no test coverage detected