* Computes a simple numeric hash of a string for analytics grouping. * Uses djb2 algorithm, returning a 32-bit unsigned integer.
(str: string)
| 130 | * Uses djb2 algorithm, returning a 32-bit unsigned integer. |
| 131 | */ |
| 132 | function hashString(str: string): number { |
| 133 | let hash = 5381 |
| 134 | for (let i = 0; i < str.length; i++) { |
| 135 | hash = ((hash << 5) + hash + str.charCodeAt(i)) | 0 |
| 136 | } |
| 137 | return hash >>> 0 |
| 138 | } |
| 139 | |
| 140 | export type ImageDimensions = { |
| 141 | originalWidth?: number |
no outgoing calls
no test coverage detected