-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor project structure and update dependencies (#83)
* Move main.rs to bin folder * Refactor all modules to a library * Rename library * Update file paths and imports * Update rustgenhash version to 0.9.0 in Cargo.lock and Cargo.toml
- Loading branch information
1 parent
7be4363
commit 493f364
Showing
9 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rustgenhash" | ||
version = "0.8.5" | ||
version = "0.9.0" | ||
license = "MIT" | ||
authors = ["Volker Schwaberow <[email protected]>"] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,7 @@ | |
// Author: Volker Schwaberow <[email protected]> | ||
// Copyright (c) 2022 Volker Schwaberow | ||
|
||
mod analyze; | ||
mod app; | ||
mod hash; | ||
mod hhhash; | ||
mod random; | ||
use rustgenhash::rgh::app; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
app::run()?; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
// Project: rustgenhash | ||
// File: analyze.rs | ||
// Author: Volker Schwaberow <[email protected]> | ||
// Copyright (c) 2022 Volker Schwaberow | ||
|
||
pub mod rgh { | ||
pub mod analyze; | ||
pub mod app; | ||
pub mod hash; | ||
pub mod hhhash; | ||
pub mod random; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,10 @@ | |
// Author: Volker Schwaberow <[email protected]> | ||
// 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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// Author: Volker Schwaberow <[email protected]> | ||
// 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; | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// Author: Volker Schwaberow <[email protected]> | ||
// 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; | ||
|