Skip to main content

Module hash

Module hash 

Source
Expand description

Content hashing with deterministic normalization (§5.3).

The hash covers a memo’s full meaningful state — body, tags, favorite flag, and color — so the sync diff (§9.2) detects metadata-only edits (tag/favorite/ color changes), not just body edits. The digest must be stable regardless of how a memo was written — vim’s atomic-rename, a shell redirect, or oximemo’s own writer must all produce the same digest for identical state. Normalization therefore precedes hashing.

Functions§

hash_content
Hash normalized content, returning a prefixed b3: digest.
hash_memo
Hash a memo’s full meaningful state: body + tags + favorite + category (§5.3).
hash_normalized
Hash an already-normalized string. Used internally when the body has been produced by our own writer and is known-normal.
normalize
Normalize note body bytes before hashing.