// License: see LICENSE file at root directory of `master` branch

//! # Dia-Hammer
//!
//! ## Project
//!
//! - Repository: <https://bitbucket.org/haibison/hammer>
//! - 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 program helps hash data from either an input string, stdin, or file(s).
//! - Supported algorithms: SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, SHAKE256.
//!
//! ## Building from source or installing via Cargo
//!
//! This crate is intended to be used as a program. So default features just contain some documentation, constants and no dependencies.
//!
//! `bin` feature contains a binary which uses some dependencies.
//!
//! ### Building from source:
//!
//! ```shell
//! ~> # Clone a specific version via tag name
//! ~> git clone --branch=x.y.z --depth=1 -- https://bitbucket.org/haibison/hammer hammer-x.y.z/
//! ~> cd hammer-x.y.z/
//! ~> cargo build --release --features=bin
//! ```
//!
//! ### Installing via Cargo:
//!
//! ```shell
//! ~> cargo install dia-hammer --version=x.y.z --features=bin
//! ```
//!
//! ## Examples
//!
//! ```shell
//! ~> # Print help
//! ~> hammer help
//! ...
//!
//! ~> # Hash an input string
//! ~> hammer shake-128 haha
//! 05ea9934234a88a31e67a1638a7936d7 (Shake-128)
//!
//! ~> # Hash multiple input files
//! ~> hammer sha3-224 -- /tmp/*.json
//! 6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7 [SHA3-224] /tmp/haha.json
//! 1931dd1553cf52ee145747ad8c0f34906022eeb788a6aa955bbf3600 [SHA3-224] /tmp/test.json
//!
//! ~> # Hash data fed via stdin
//! ~> cat /tmp/test.json | hammer sha3-256
//! cd424cbc9ab978b547332e3ee4f2ebfe715e9cd9144a5437982cc6e16327a0eb (SHA3-256)
//!
//! ~> # Hash a string and print the hash as hex-array, which is useful for programmers
//! ~> hammer shake128 namaste --format=hex-array
//! [0xe3, 0xcd, 0x77, 0x06, 0x27, 0x84, 0x1f, 0x8e, 0xb6, 0x0c, 0xfd, 0x3e, 0xa6, 0x93, 0x17, 0x1e] (Shake-128)
//!
//! ~> # On Unix, hash 64 KiB of data from /dev/urandom
//! ~> hammer sha3-224 --limit=65536 -- /dev/urandom
//! 3779d6c9ce150bd02ebfa7e353c85bc4934c0a16ebf736946143f121 [SHA3-224] /dev/urandom
//! ```
//!
//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html

#![warn(missing_docs)]

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

macro_rules! code_name  { () => { "dia-hammer" }}
macro_rules! version    { () => { "2.0.0" }}

/// # Crate name
pub const NAME: &str = "Dia-Hammer";

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

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

/// # Crate release date (year/month/day)
pub const RELEASE_DATE: (u16, u8, u8) = (2021, 1, 10);

/// # Unique universally identifier of this crate
pub const UUID: &str = "d38d8f87-b393-4383-bbb6-3868019b9a61";

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

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

pub mod version_info;

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