This is an automated email from the ASF dual-hosted git repository. tisonkun pushed a commit to branch hashable in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit f5a72026eb9dce94ae3dfa25fce369ffe9e35c57 Author: tison <[email protected]> AuthorDate: Thu May 7 09:23:53 2026 +0800 docs Signed-off-by: tison <[email protected]> --- datasketches/src/hash_value/mod.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/datasketches/src/hash_value/mod.rs b/datasketches/src/hash_value/mod.rs index 2d908da..38eab07 100644 --- a/datasketches/src/hash_value/mod.rs +++ b/datasketches/src/hash_value/mod.rs @@ -1,4 +1,20 @@ -//! HashValue +//! Hashable value wrappers for sketches. +//! +//! Sketch update APIs accept any value that implements [`Hash`]. For most Rust values, +//! passing the value directly is sufficient. This module provides [`Canonical`] wrappers for +//! cases where the input must follow compatible canonicalization rules as other datasketches +//! implementation. +//! +//! Canonicalization is useful when the same logical value can have multiple Rust representations. +//! For example, `f32` and `f64` floating-point inputs are canonicalized through the same `f64` +//! representation, signed zero values hash the same, and all NaN values use one canonical NaN bit +//! pattern. Narrow integer inputs are canonicalized through datasketches-cpp's signed-extension +//! rules. Byte and string inputs are hashed as raw bytes without Rust's slice or string length +//! prefix. +//! +//! Empty byte and string inputs have zero bytes to hash. datasketches-cpp skips empty strings +//! before hashing, so check `Canonical::is_empty` before updating a sketch when that behavior +//! matters. mod canonical; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
