Function ssdeep::compare

source ·
pub fn compare(lhs: &str, rhs: &str) -> Result<u32, ParseErrorEither>
Available on crate feature easy-functions only.
Expand description

Compare two fuzzy hashes.

If a parse error occurs, Err containing a parse error is returned. Otherwise, Ok containing the similarity score (0..=100) is returned.

§Example

assert_eq!(
    ssdeep::compare(
        "6:3ll7QzDkmJmMHkQoO/llSZEnEuLszmbMAWn:VqDk5QtLbW",
        "6:3ll7QzDkmQjmMoDHglHOxPWT0lT0lT0lB:VqDk+n"
    ).unwrap(),
    46
);