-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing normalization. After feedback and further consideration, I d…
…ecided that normalization reduced security without offering much in the way of benefits. It was intended to help reduce mistypings, but's likely that a user will run this multiple times anyway to confirm it creates a consistent mnemonic.
- Loading branch information
Showing
5 changed files
with
11 additions
and
164 deletions.
There are no files selected for viewing
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
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
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
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
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,20 +1,4 @@ | ||
use crate::{cli::Cli, generator::Generator}; | ||
|
||
pub fn exit_with_error(msg: &str) -> ! { | ||
eprintln!("{msg}"); | ||
std::process::exit(1) | ||
} | ||
|
||
pub fn show_only_normalize(cli: &Cli, gen: &Generator) { | ||
if cli.normalized_only { | ||
let s = std::str::from_utf8(gen.data()); | ||
|
||
if let Ok(s) = s { | ||
let s = gen.normalize(s); | ||
println!("{s}"); | ||
std::process::exit(0); | ||
} else { | ||
exit_with_error("Binary data cannot be normalized."); | ||
} | ||
} | ||
} |