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
70
71
72
73
74
75
76
77
78
79
80
81
82
// License: see LICENSE file at root directory of `master` branch

//! # Extensions for hashing crates
//!
//! ## Project
//!
//! - Repository: <https://bitbucket.org/haibison/zeros>
//! - License: Nice License 1.0.0 _(see LICENSE file at root directory of `master` branch)_
//! - _This project follows [Semantic Versioning 2.0.0]_
//!
//! ## Features
//!
//! This project provides some extensions which can be used with hashing crates, such as [`tiny-keccak`][crate:tiny-keccak].
//!
//! ## Notes
//!
//! The crate uses `#![no_std]` by default. Documentation is built with all features, which include `std`. If you see some components from
//! [`std`][crate:std] crate, you have to use that feature.
//!
//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html
//! [crate:std]: https://doc.rust-lang.org/std/
//! [crate:tiny-keccak]: https://crates.io/crates/tiny-keccak

#![warn(missing_docs)]
#![no_std]

// ╔═════════════════╗
// ║   IDENTIFIERS   ║
// ╚═════════════════╝

macro_rules! code_name  { () => { "zeros" }}
macro_rules! version    { () => { "6.1.0" }}

/// # Crate name
pub const NAME: &str = "Zeros";

/// # Crate code name
pub const CODE_NAME: &str = code_name!();

/// # ID of this crate
pub const ID: &str = concat!(
    "85ede580-25ef8822-72185cb5-6608f8ae-3c960bc1-75e3ab78-6d1f8a8a-55eb5c40-",
    "f0b681d6-13275f82-d587a89e-9de72f64-3951a1b0-79f48b29-de4a6330-817a600f",
);

/// # Crate version
pub const VERSION: &str = version!();

/// # Crate release date (year/month/day)
pub const RELEASE_DATE: (u16, u8, u8) = (2019, 8, 28);

/// # Tag, which can be used for logging...
pub const TAG: &str = concat!(code_name!(), "::85ede580::", version!());

// ╔════════════════════╗
// ║   IMPLEMENTATION   ║
// ╚════════════════════╝

extern crate alloc;

#[cfg(feature="std")]
extern crate std;

pub mod version_info;

mod error;
mod read_only_zeros;
mod zeros;

pub use crate::{
    error::*,
    read_only_zeros::*,
    zeros::*,
};

/// # Result type used in this crate
pub type Result<'a, T> = core::result::Result<T, Error<'a>>;

#[test]
fn test_crate_version() {
    assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
}