Skip to content

calternal_notes_core::identity

Stable Note identity and cross-platform filename shaping.

Source: crates/calternal-notes-core/src/identity.rs

pub fn id_slice(id: &str) -> String

Return the first eight ASCII hex digits in an identity, in lowercase.

Source: crates/calternal-notes-core/src/identity.rs:36

pub fn mint_calternal_id(mut fill_random: impl FnMut(&mut [u8])) -> String

Mint a v4 calternal-id from caller-supplied random bytes.

The caller owns the random source. This keeps identity minting deterministic in tests and prevents the pure crate from reading OS state.

Source: crates/calternal-notes-core/src/identity.rs:9

pub fn note_filename(date: &str, title: &str, id: &str) -> String

Build the canonical Notes filename. The date is compacted by removing hyphens, and the Note identity remains stable when the slug changes.

Source: crates/calternal-notes-core/src/identity.rs:46

pub fn slugify(title: &str) -> String

Match calternal.js slugify: NFD, ASCII lowercase alphanumerics, collapsed ASCII separators, silent drop of non-ASCII leftovers, and a 64-byte cap.

Source: crates/calternal-notes-core/src/identity.rs:67

pub fn task_filename(date: &str, title: &str, id: &str) -> String

Build the canonical task filename in Notes using the same date, slug, and identity slice as any other Note. Frontmatter carries the Task meaning.

Source: crates/calternal-notes-core/src/identity.rs:52