1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Defines HoloHash and its various HashTypes

#![deny(missing_docs)]

mod aliases;
pub mod error;
mod has_hash;
mod hash;
pub mod hash_type;

pub use aliases::*;
pub use has_hash::HasHash;
pub use hash::*;
pub use hash_type::HashType;
pub use hash_type::PrimitiveHashType;

// feature: serialization (enabled by default)
// (serde, SerializedBytes)

#[cfg(feature = "serialization")]
mod hashed;
#[cfg(feature = "serialization")]
pub use hashed::*;

#[cfg(feature = "serialization")]
mod hashable_content;
#[cfg(feature = "serialization")]
pub use hashable_content::*;

#[cfg(feature = "serialization")]
mod ser;

#[cfg(feature = "serialization")]
/// A convenience type, for specifying a hash by HashableContent rather than
/// by its HashType
pub type HoloHashOf<C> = HoloHash<<C as HashableContent>::HashType>;

// feature: encoding
// (string encoding)

#[cfg(feature = "encoding")]
pub use encode::{blake2b_256, holo_hash_decode, holo_hash_decode_unchecked, holo_hash_encode};

/// By default, disable string encoding and just display raw bytes
#[cfg(not(feature = "encoding"))]
pub mod encode_raw;

/// Include nice string encoding methods and From impls
#[cfg(feature = "encoding")]
pub mod encode;

#[cfg(feature = "encoding")]
mod hash_b64;
#[cfg(feature = "encoding")]
pub use hash_b64::*;

// feature: hashing
// (blake2b hashing for hash generation and DHT location calculation)

#[cfg(feature = "hashing")]
mod hash_ext;

#[cfg(feature = "hashing")]
pub use hash_ext::*;

// feature: fixturators
// provides fixturators for all hash types
#[cfg(feature = "fixturators")]
pub mod fixt;