MCPcopy Index your code
hub / github.com/codeaashu/claude-code / hashString

Function hashString

src/utils/imageResizer.ts:130–136  ·  view source on GitHub ↗

* Computes a simple numeric hash of a string for analytics grouping. * Uses djb2 algorithm, returning a 32-bit unsigned integer.

(str: string)

Source from the content-addressed store, hash-verified

128 * Uses djb2 algorithm, returning a 32-bit unsigned integer.
129 */
130function hashString(str: string): number {
131 let hash = 5381
132 for (let i = 0; i < str.length; i++) {
133 hash = ((hash << 5) + hash + str.charCodeAt(i)) | 0
134 }
135 return hash >>> 0
136}
137
138export type ImageDimensions = {
139 originalWidth?: number

Callers 2

compressImageBufferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected