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
//! This crate contains the common types and functions used by the WNFS crates.
pub mod blockstore;
mod encoding;
mod error;
mod link;
mod metadata;
mod pathnodes;
mod storable;
pub mod utils;

pub use blockstore::*;
pub use encoding::*;
pub use error::*;
pub use link::*;
pub use metadata::*;
pub use pathnodes::*;
pub use storable::*;

//--------------------------------------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------------------------------------

pub const HASH_BYTE_SIZE: usize = 32;
pub const MAX_BLOCK_SIZE: usize = usize::pow(2, 18);

//--------------------------------------------------------------------------------------------------
// Type Definitions
//--------------------------------------------------------------------------------------------------

/// The general size of digests in WNFS.
pub type HashOutput = [u8; HASH_BYTE_SIZE];

//--------------------------------------------------------------------------------------------------
// Re-exports
//--------------------------------------------------------------------------------------------------

pub mod libipld {
    pub use libipld::*;
}