#![doc = include_str!("_docs/readme.md")]
#![no_std]
#![cfg_attr(
feature = "unstable",
feature(
coverage_attribute,
doc_cfg,
doc_auto_cfg,
likely_unlikely,
trusted_len
)
)]
#![cfg_attr(feature = "maint-code", deny(warnings))]
#![cfg_attr(
not(any(
feature = "unsafe",
feature = "unsafe-guarantee",
feature = "unchecked",
test
)),
forbid(unsafe_code)
)]
#![cfg_attr(
all(
not(any(feature = "unsafe", test)),
any(feature = "unchecked", feature = "unsafe-guarantee")
),
deny(unsafe_code)
)]
#![cfg_attr(not(test), warn(missing_docs, clippy::missing_docs_in_private_items))]
#![cfg_attr(
not(feature = "maint-lints"),
allow(unknown_lints, renamed_and_removed_lints)
)]
#![cfg_attr(
test,
allow(
unused_unsafe,
clippy::assertions_on_constants,
clippy::int_plus_one,
clippy::identity_op,
clippy::erasing_op,
clippy::overly_complex_bool_expr,
clippy::logic_bug, // renamed to clippy::overly_complex_bool_expr
clippy::nonminimal_bool
)
)]
#[cfg(any(feature = "alloc", test, doc))]
extern crate alloc;
#[cfg(any(feature = "std", test, doc))]
extern crate std;
mod internals;
#[cfg(doc)]
#[allow(missing_docs)]
pub mod _docs;
pub use crate::internals::compare::FuzzyHashCompareTarget;
#[cfg(feature = "easy-functions")]
pub use crate::internals::compare_easy::{compare, ParseErrorEither, ParseErrorSide};
pub use crate::internals::generate::{Generator, GeneratorError};
#[cfg(feature = "easy-functions")]
pub use crate::internals::generate_easy::hash_buf;
#[cfg(all(feature = "easy-functions", feature = "std"))]
pub use crate::internals::generate_easy_std::{hash_file, hash_stream, GeneratorOrIOError};
pub use crate::internals::hash::block::{block_hash, block_size, BlockSizeRelation};
pub use crate::internals::hash::parser_state::{
ParseError, ParseErrorInfo, ParseErrorKind, ParseErrorOrigin,
};
pub use crate::internals::hash::{
FuzzyHash, FuzzyHashData, FuzzyHashOperationError, LongFuzzyHash, LongRawFuzzyHash,
RawFuzzyHash,
};
pub use crate::internals::hash_dual::{DualFuzzyHash, FuzzyHashDualData, LongDualFuzzyHash};
#[deprecated]
pub mod internal_hashes {
pub use crate::internals::generate::{PartialFNVHash, RollingHash};
}
#[deprecated]
pub mod internal_comparison {
pub use crate::internals::compare::position_array::{
block_hash_position_array_element, BlockHashPositionArray, BlockHashPositionArrayData,
BlockHashPositionArrayImpl,
};
#[cfg(feature = "unchecked")]
pub use crate::internals::compare::position_array::BlockHashPositionArrayImplUnchecked;
}
pub mod constraints {
pub use crate::internals::hash::block::{
BlockHashSize, BlockHashSizes, ConstrainedBlockHashSize, ConstrainedBlockHashSizes,
};
}
pub mod prelude {}
pub const MAX_LEN_IN_STR: usize = LongRawFuzzyHash::MAX_LEN_IN_STR;
#[doc(hidden)]
mod const_asserts {
use static_assertions::const_assert;
use super::*;
const_assert!(usize::BITS >= 16);
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);
}
mod tests;