Skip to content

Commit d9c6e83

Browse files
committed
doc: Improvements for index windows
1 parent 7f81803 commit d9c6e83

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ffuzzy/src/hash.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ where
16411641
/// # */
16421642
///
16431643
/// // It stores a fuzzy hash with keys (with duplicates) like this:
1644-
/// // db_entries(log_block_size, substring).add(hash_index)
1644+
/// // db_entries(concat(log_block_size, substring)).add(hash_index)
16451645
/// // ... to enable later filtering.
16461646
/// fn insert_to_database(key: u64, value: &FuzzyHashIndex) { /* ... */ }
16471647
///
@@ -1657,6 +1657,9 @@ where
16571657
/// }
16581658
/// ```
16591659
///
1660+
/// Compared to numeric windows, the effective block size is embedded in
1661+
/// the index windows. That makes writing ssdeep database easier.
1662+
///
16601663
/// # Effectively Deprecated from the Start
16611664
///
16621665
/// This is a preview of a feature in the next major release.
@@ -1667,7 +1670,7 @@ where
16671670
/// something like: `hash.block_hash_1().index_windows()`.
16681671
///
16691672
/// The only reason this function is *not* marked deprecated is,
1670-
/// every block hash functions will change in the next major release
1673+
/// all block hash functions will change in the next major release
16711674
/// and deprecating all of them gives the developer wrong impressions
16721675
/// (it doesn't and won't have non-deprecated interface in v0.3.x anyway).
16731676
#[inline]
@@ -1721,7 +1724,7 @@ where
17211724
/// something like: `hash.block_hash_2().index_windows()`.
17221725
///
17231726
/// The only reason this function is *not* marked deprecated is,
1724-
/// every block hash functions will change in the next major release
1727+
/// all block hash functions will change in the next major release
17251728
/// and deprecating all of them gives the developer wrong impressions
17261729
/// (it doesn't and won't have non-deprecated interface in v0.3.x anyway).
17271730
#[inline]

ffuzzy/src/hash/block.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,12 @@ pub mod block_hash {
446446
/// corresponding a substring of length [`MIN_LCS_FOR_COMPARISON`] *and*
447447
/// the block size.
448448
///
449+
/// An object with this type is created by either of those methods
450+
/// (*normalized forms only*):
451+
///
452+
/// * [`FuzzyHashData::block_hash_1_index_windows()`](crate::hash::FuzzyHashData::block_hash_1_index_windows())
453+
/// * [`FuzzyHashData::block_hash_2_index_windows()`](crate::hash::FuzzyHashData::block_hash_2_index_windows())
454+
///
449455
/// This is similar to that of [`NumericWindows`] but each numeric value
450456
/// *also* contains the *base-2 logarithm* form of the block size
451457
/// (at highest bits).

0 commit comments

Comments
 (0)