fn djb2_hash(s: &str) -> u32Expand description
Hash matching Claude Code’s sessionStoragePortable.ts implementation.
JS charCodeAt() iterates UTF-16 code units (two surrogates per non-BMP char);
Rust chars() iterates Unicode scalar values — they diverge for emoji/non-BMP.
encode_utf16() produces the same UTF-16 unit stream as JS, so the hashes match.