#![doc = include_str!("docs/readme.md")]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "nightly", feature(doc_cfg))]
#![cfg_attr(feature = "nightly", feature(doc_auto_cfg))]
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
#![cfg_attr(feature = "nightly", feature(error_in_core))]
#![cfg_attr(feature = "nightly", feature(coverage_attribute))]
#![cfg_attr(ffuzzy_ilog2 = "unstable", feature(int_log))]
#![cfg_attr(ffuzzy_div_ceil = "unstable", feature(int_roundings))]
#![cfg_attr(not(any(feature = "unsafe", feature = "unchecked", test)), forbid(unsafe_code))]
#![cfg_attr(all(feature = "unchecked", not(any(feature = "unsafe", test))), deny(unsafe_code))]
#![cfg_attr(not(test), warn(missing_docs))]
#![cfg_attr(not(feature = "maint-lints"), allow(unknown_lints))]
#![cfg_attr(not(feature = "maint-lints"), allow(renamed_and_removed_lints))]
#![cfg_attr(test, allow(clippy::assertions_on_constants))]
#![cfg_attr(test, allow(clippy::int_plus_one))]
#![cfg_attr(test, allow(clippy::identity_op))]
#![cfg_attr(test, allow(clippy::or_fun_call))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(test)]
#[macro_use]
extern crate std;
mod base64;
mod compare;
mod compare_easy;
mod generate;
mod generate_easy;
mod generate_easy_std;
mod hash;
mod hash_dual;
mod intrinsics;
mod macros;
mod test_utils;
mod utils;
#[cfg(doc)]
#[allow(missing_docs)]
pub mod docs;
pub use compare::FuzzyHashCompareTarget;
#[cfg(feature = "easy-functions")]
pub use compare_easy::{compare, ParseErrorEither, ParseErrorSide};
pub use generate::{Generator, GeneratorError};
#[cfg(feature = "easy-functions")]
pub use generate_easy::hash_buf;
#[cfg(all(feature = "easy-functions", feature = "std"))]
pub use generate_easy_std::{hash_file, hash_stream, GeneratorOrIOError};
pub use hash::{
FuzzyHashData,
FuzzyHash, RawFuzzyHash, LongFuzzyHash, LongRawFuzzyHash,
FuzzyHashOperationError
};
pub use hash::block::{
block_size,
block_hash,
BlockSizeRelation
};
#[deprecated]
pub use hash::block::block_size as BlockSize;
#[deprecated]
pub use hash::block::block_hash as BlockHash;
pub use hash::parser_state::{
ParseError, ParseErrorInfo, ParseErrorKind, ParseErrorOrigin
};
pub use hash_dual::{
FuzzyHashDualData,
DualFuzzyHash, LongDualFuzzyHash
};
pub mod internal_hashes {
pub use super::generate::{PartialFNVHash, RollingHash};
}
pub mod internal_comparison {
pub use super::compare::position_array::{
BlockHashPositionArray,
BlockHashPositionArrayData,
BlockHashPositionArrayImpl,
block_hash_position_array_element,
};
#[deprecated]
pub use super::compare::position_array::block_hash_position_array_element as BlockHashPositionArrayElement;
#[cfg(feature = "unchecked")]
pub use super::compare::position_array::BlockHashPositionArrayImplUnchecked;
#[cfg(feature = "unchecked")]
#[deprecated]
pub use super::compare::position_array::BlockHashPositionArrayImplUnchecked as BlockHashPositionArrayImplUnsafe;
}
pub mod constraints {
pub use super::hash::block::{
BlockHashSize, ConstrainedBlockHashSize,
BlockHashSizes, ConstrainedBlockHashSizes
};
}
pub const MAX_LEN_IN_STR: usize = LongRawFuzzyHash::MAX_LEN_IN_STR;
#[doc(hidden)]
mod const_asserts {
use super::*;
use static_assertions::const_assert;
const_assert!(usize::BITS >= 8);
const_assert!(MAX_LEN_IN_STR >= FuzzyHash::MAX_LEN_IN_STR);
const_assert!(MAX_LEN_IN_STR >= RawFuzzyHash::MAX_LEN_IN_STR);
const_assert!(MAX_LEN_IN_STR >= LongFuzzyHash::MAX_LEN_IN_STR);
const_assert!(MAX_LEN_IN_STR >= LongRawFuzzyHash::MAX_LEN_IN_STR);
}