(content: string)
| 20 | } |
| 21 | |
| 22 | export function checksum(content: string): string | undefined { |
| 23 | if (!content) return undefined |
| 24 | let hash = 0x811c9dc5 |
| 25 | for (let i = 0; i < content.length; i++) { |
| 26 | hash ^= content.charCodeAt(i) |
| 27 | hash = Math.imul(hash, 0x01000193) |
| 28 | } |
| 29 | return (hash >>> 0).toString(36) |
| 30 | } |
| 31 | |
| 32 | export function sampledChecksum(content: string, limit = 500_000): string | undefined { |
| 33 | if (!content) return undefined |
no outgoing calls
no test coverage detected