wnfs_common/
lib.rs

1//! This crate contains the common types and functions used by the WNFS crates.
2pub mod blockstore;
3mod error;
4mod link;
5mod metadata;
6mod pathnodes;
7mod storable;
8pub mod utils;
9
10pub use blockstore::*;
11pub use error::*;
12pub use link::*;
13pub use metadata::*;
14pub use pathnodes::*;
15pub use storable::*;
16
17//--------------------------------------------------------------------------------------------------
18// Constants
19//--------------------------------------------------------------------------------------------------
20
21pub const HASH_BYTE_SIZE: usize = 32;
22pub const MAX_BLOCK_SIZE: usize = usize::pow(2, 18);
23
24//--------------------------------------------------------------------------------------------------
25// Type Definitions
26//--------------------------------------------------------------------------------------------------
27
28/// The general size of digests in WNFS.
29pub type HashOutput = [u8; HASH_BYTE_SIZE];
30
31//--------------------------------------------------------------------------------------------------
32// Re-exports
33//--------------------------------------------------------------------------------------------------
34
35pub use cid::Cid;
36
37pub mod ipld_core {
38    pub use ipld_core::*;
39}