bitwise() — astro Function Reference
Architecture documentation for the bitwise() function in shorthash.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD ab9ac294_9bdd_8583_b24f_ee7907d60dd7["bitwise()"] 1931224b_3710_e27c_adb3_a9fbb99cec90["shorthash.ts"] ab9ac294_9bdd_8583_b24f_ee7907d60dd7 -->|defined in| 1931224b_3710_e27c_adb3_a9fbb99cec90 e7eb71b4_4909_3f1b_44fa_140138298bae["shorthash()"] e7eb71b4_4909_3f1b_44fa_140138298bae -->|calls| ab9ac294_9bdd_8583_b24f_ee7907d60dd7 style ab9ac294_9bdd_8583_b24f_ee7907d60dd7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/runtime/server/shorthash.ts lines 36–45
function bitwise(str: string) {
let hash = 0;
if (str.length === 0) return hash;
for (let i = 0; i < str.length; i++) {
const ch = str.charCodeAt(i);
hash = (hash << 5) - hash + ch;
hash = hash & hash; // Convert to 32bit integer
}
return hash;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does bitwise() do?
bitwise() is a function in the astro codebase, defined in packages/astro/src/runtime/server/shorthash.ts.
Where is bitwise() defined?
bitwise() is defined in packages/astro/src/runtime/server/shorthash.ts at line 36.
What calls bitwise()?
bitwise() is called by 1 function(s): shorthash.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free