Skip to main content

Module hash

Module hash 

Source

Functionsยง

content_hash
short_hash
structural_hash
Compute a structural hash from a tree-sitter AST node. Strips comments and normalizes whitespace so formatting-only changes produce the same hash. Uses streaming xxHash64 to avoid intermediate string allocations.
structural_hash_excluding_range
Compute a structural hash that excludes tokens within a given byte range. Used to strip the entity name from the hash so that renames of otherwise identical entities produce the same hash, enabling Phase 2 rename detection.