diff --git a/Cargo.lock b/Cargo.lock index 9331ac9..19926cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1165,7 +1165,7 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustgenhash" -version = "0.8.5" +version = "0.9.0" dependencies = [ "argon2", "ascon-hash", diff --git a/Cargo.toml b/Cargo.toml index 62b0c7e..a7b43c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustgenhash" -version = "0.8.5" +version = "0.9.0" license = "MIT" authors = ["Volker Schwaberow "] description = "A tool to generate hashes from the command line." @@ -14,7 +14,7 @@ categories = ["command-line-utilities", "cryptography"] [[bin]] name = "rgh" -path = "src/main.rs" +path = "src/bin/main.rs" [profile.release] strip = "symbols" diff --git a/src/main.rs b/src/bin/main.rs similarity index 82% rename from src/main.rs rename to src/bin/main.rs index 91948e7..771b646 100644 --- a/src/main.rs +++ b/src/bin/main.rs @@ -4,11 +4,7 @@ // Author: Volker Schwaberow // Copyright (c) 2022 Volker Schwaberow -mod analyze; -mod app; -mod hash; -mod hhhash; -mod random; +use rustgenhash::rgh::app; fn main() -> Result<(), Box> { app::run()?; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..9f96fb1 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// Project: rustgenhash +// File: analyze.rs +// Author: Volker Schwaberow +// Copyright (c) 2022 Volker Schwaberow + +pub mod rgh { + pub mod analyze; + pub mod app; + pub mod hash; + pub mod hhhash; + pub mod random; +} diff --git a/src/analyze.rs b/src/rgh/analyze.rs similarity index 100% rename from src/analyze.rs rename to src/rgh/analyze.rs diff --git a/src/app.rs b/src/rgh/app.rs similarity index 98% rename from src/app.rs rename to src/rgh/app.rs index a291f89..1e2b8e9 100644 --- a/src/app.rs +++ b/src/rgh/app.rs @@ -4,11 +4,10 @@ // Author: Volker Schwaberow // Copyright (c) 2022 Volker Schwaberow -use crate::analyze; -use crate::hash::{PHash, RHash}; -use crate::hhhash::generate_hhhash; -use crate::random::{RandomNumberGenerator, RngType}; -use analyze::HashAnalyzer; +use crate::rgh::analyze::HashAnalyzer; +use crate::rgh::hash::{PHash, RHash}; +use crate::rgh::hhhash::generate_hhhash; +use crate::rgh::random::{RandomNumberGenerator, RngType}; use clap::{crate_name, Arg}; use clap_complete::{generate, Generator, Shell}; use std::error::Error; diff --git a/src/hash.rs b/src/rgh/hash.rs similarity index 99% rename from src/hash.rs rename to src/rgh/hash.rs index fc1f671..74c65eb 100644 --- a/src/hash.rs +++ b/src/rgh/hash.rs @@ -4,7 +4,7 @@ // Author: Volker Schwaberow // Copyright (c) 2022 Volker Schwaberow -use crate::app::OutputOptions; +use crate::rgh::app::OutputOptions; use argon2::{ password_hash::{rand_core::OsRng, PasswordHasher, SaltString}, Argon2, @@ -302,7 +302,6 @@ impl RHash { } } - #[test] fn test_argon2() { use argon2::PasswordVerifier; diff --git a/src/hhhash.rs b/src/rgh/hhhash.rs similarity index 100% rename from src/hhhash.rs rename to src/rgh/hhhash.rs diff --git a/src/random.rs b/src/rgh/random.rs similarity index 98% rename from src/random.rs rename to src/rgh/random.rs index 1946ebc..b1e1fbe 100644 --- a/src/random.rs +++ b/src/rgh/random.rs @@ -4,7 +4,7 @@ // Author: Volker Schwaberow // Copyright (c) 2022 Volker Schwaberow -use crate::app::OutputOptions; +use crate::rgh::app::OutputOptions; use base64::{encode_config, URL_SAFE_NO_PAD}; use getrandom::getrandom; use rand::thread_rng;