1#![doc = include_str!("_docs/readme.md")]
6#![no_std]
8#![cfg_attr(
10 feature = "unstable",
11 feature(
12 coverage_attribute,
13 doc_cfg,
14 doc_auto_cfg,
15 likely_unlikely,
16 trusted_len
17 )
18)]
19#![cfg_attr(feature = "maint-code", deny(warnings))]
21#![cfg_attr(
25 not(any(
26 feature = "unsafe",
27 feature = "unsafe-guarantee",
28 feature = "unchecked",
29 test
30 )),
31 forbid(unsafe_code)
32)]
33#![cfg_attr(
34 all(
35 not(any(feature = "unsafe", test)),
36 any(feature = "unchecked", feature = "unsafe-guarantee")
37 ),
38 deny(unsafe_code)
39)]
40#![cfg_attr(not(test), warn(missing_docs, clippy::missing_docs_in_private_items))]
42#![cfg_attr(
44 not(feature = "maint-lints"),
45 allow(unknown_lints, renamed_and_removed_lints)
46)]
47#![cfg_attr(
49 test,
50 allow(
51 unused_unsafe,
52 clippy::assertions_on_constants,
53 clippy::int_plus_one,
54 clippy::identity_op,
55 clippy::erasing_op,
56 clippy::overly_complex_bool_expr,
57 clippy::logic_bug, clippy::nonminimal_bool
59 )
60)]
61
62#[cfg(any(feature = "alloc", test, doc))]
64extern crate alloc;
65#[cfg(any(feature = "std", test, doc))]
66extern crate std;
67
68mod internals;
69
70#[cfg(doc)]
71#[allow(missing_docs)]
72pub mod _docs;
73
74pub use crate::internals::compare::FuzzyHashCompareTarget;
75#[cfg(feature = "easy-functions")]
76pub use crate::internals::compare_easy::{compare, ParseErrorEither, ParseErrorSide};
77pub use crate::internals::generate::{Generator, GeneratorError};
78#[cfg(feature = "easy-functions")]
79pub use crate::internals::generate_easy::hash_buf;
80#[cfg(all(feature = "easy-functions", feature = "std"))]
81pub use crate::internals::generate_easy_std::{hash_file, hash_stream, GeneratorOrIOError};
82pub use crate::internals::hash::block::{block_hash, block_size, BlockSizeRelation};
83pub use crate::internals::hash::parser_state::{
84 ParseError, ParseErrorInfo, ParseErrorKind, ParseErrorOrigin,
85};
86pub use crate::internals::hash::{
87 FuzzyHash, FuzzyHashData, FuzzyHashOperationError, LongFuzzyHash, LongRawFuzzyHash,
88 RawFuzzyHash,
89};
90pub use crate::internals::hash_dual::{DualFuzzyHash, FuzzyHashDualData, LongDualFuzzyHash};
91
92#[deprecated]
100pub mod internal_hashes {
101 pub use crate::internals::generate::{PartialFNVHash, RollingHash};
102}
103
104#[deprecated]
112pub mod internal_comparison {
113 pub use crate::internals::compare::position_array::{
114 block_hash_position_array_element, BlockHashPositionArray, BlockHashPositionArrayData,
115 BlockHashPositionArrayImpl,
116 };
117
118 #[cfg(feature = "unchecked")]
119 pub use crate::internals::compare::position_array::BlockHashPositionArrayImplUnchecked;
120}
121
122pub mod constraints {
124 pub use crate::internals::hash::block::{
125 BlockHashSize, BlockHashSizes, ConstrainedBlockHashSize, ConstrainedBlockHashSizes,
126 };
127}
128
129pub mod prelude {}
140
141pub const MAX_LEN_IN_STR: usize = LongRawFuzzyHash::MAX_LEN_IN_STR;
152
153#[doc(hidden)]
155mod const_asserts {
156 use static_assertions::const_assert;
157
158 use super::*;
159
160 const_assert!(usize::BITS >= 16);
163
164 const_assert!(MAX_LEN_IN_STR >= FuzzyHash::MAX_LEN_IN_STR);
167 const_assert!(MAX_LEN_IN_STR >= RawFuzzyHash::MAX_LEN_IN_STR);
168 const_assert!(MAX_LEN_IN_STR >= LongFuzzyHash::MAX_LEN_IN_STR);
169 const_assert!(MAX_LEN_IN_STR >= LongRawFuzzyHash::MAX_LEN_IN_STR);
170}
171
172mod tests;