1#![doc = include_str!("_docs/readme.md")]
6#![cfg_attr(not(any(test, doc, feature = "std")), no_std)]
8#![cfg_attr(feature = "unstable", allow(internal_features))]
10#![cfg_attr(feature = "unstable", feature(core_intrinsics))]
12#![cfg_attr(feature = "unstable", feature(coverage_attribute))]
13#![cfg_attr(feature = "unstable", feature(doc_cfg))]
14#![cfg_attr(feature = "unstable", feature(likely_unlikely))]
15#![cfg_attr(feature = "unstable", feature(portable_simd))]
16#![cfg_attr(
17 all(feature = "unstable", target_arch = "arm"),
18 feature(arm_target_feature)
19)]
20#![cfg_attr(
21 all(feature = "unstable", target_arch = "arm"),
22 feature(stdarch_arm_feature_detection)
23)]
24#![cfg_attr(
25 all(feature = "unstable", target_arch = "arm"),
26 feature(stdarch_arm_neon_intrinsics)
27)]
28#![cfg_attr(feature = "maint-code", deny(warnings))]
30#![cfg_attr(
36 not(any(feature = "simd-per-arch", feature = "unsafe")),
37 forbid(unsafe_code)
38)]
39#![cfg_attr(
40 all(feature = "simd-per-arch", not(feature = "unsafe")),
41 deny(unsafe_code)
42)]
43#![cfg_attr(not(test), warn(missing_docs))]
45#![cfg_attr(not(test), warn(clippy::missing_docs_in_private_items))]
46#![cfg_attr(not(feature = "maint-lints"), allow(unknown_lints))]
48#![cfg_attr(not(feature = "maint-lints"), allow(renamed_and_removed_lints))]
50#![cfg_attr(test, allow(unused_unsafe))]
53#![cfg_attr(test, allow(clippy::nonminimal_bool))]
55#![cfg_attr(test, allow(clippy::assertions_on_constants))]
57#![cfg_attr(test, allow(clippy::redundant_clone))]
59
60#[cfg(any(feature = "alloc", test, doc))]
62extern crate alloc;
63
64pub mod _docs;
65pub mod buckets;
66pub mod compare;
67mod compare_easy;
68pub mod errors;
69pub mod generate;
70mod generate_easy;
71mod generate_easy_std;
72pub mod hash;
73pub mod hashes;
74mod intrinsics;
75pub mod length;
76mod macros;
77mod params;
78mod parse;
79#[cfg(not(any(doc, feature = "experiment-pearson")))]
80mod pearson;
81#[cfg(any(doc, feature = "experiment-pearson"))]
82#[cfg_attr(feature = "unstable", doc(cfg(feature = "experiment-pearson")))]
83#[cfg_attr(doc, deprecated)]
84pub mod pearson;
85
86#[cfg(feature = "easy-functions")]
88pub use compare_easy::{compare, compare_with};
89#[cfg(feature = "easy-functions")]
90pub use generate_easy::{hash_buf, hash_buf_for};
91#[cfg(all(feature = "easy-functions", feature = "std"))]
92pub use generate_easy_std::{hash_file, hash_file_for, hash_stream, hash_stream_for};
93
94pub use generate::public::GeneratorType;
96pub use hash::public::FuzzyHashType;
97
98pub type Tlsh = hashes::Normal;
100
101pub type TlshGenerator = generate::Generator<Tlsh>;
103
104pub type TlshGeneratorFor<T> = generate::Generator<T>;
127
128pub mod prelude {
140 pub use super::FuzzyHashType as _;
141 pub use super::GeneratorType as _;
142
143 pub use super::Tlsh;
144 pub use super::{TlshGenerator, TlshGeneratorFor};
145}
146
147mod tests;