Skip to content

Commit

Permalink
Use default CSPRNG algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
tats-u committed Sep 5, 2021
1 parent a7c859e commit bd23319
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ locale_name_code_page = "<2"
lazy_static = "1.4.0"
zip_structs = "^0.2"
atty = "^0.2"
rand_chacha = "0.3.1"
rand = {version = "0.8.4", features = ["std_rng"]}

[dev-dependencies]
rusty-hook = "^0.11.2"
Expand Down
6 changes: 3 additions & 3 deletions src/bin/zifu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use anyhow::anyhow;
use clap::{crate_authors, crate_description, crate_version, AppSettings, Clap};
use filename_decoder::IDecoder;
use lazy_static::lazy_static;
use rand_chacha::rand_core::{RngCore, SeedableRng};
use rand_chacha::ChaChaRng;
use rand::rngs::StdRng;
use rand::{RngCore, SeedableRng};
use std::borrow::Cow;
use std::fs::File;
use std::io::{BufReader, BufWriter};
Expand Down Expand Up @@ -272,7 +272,7 @@ fn main() -> anyhow::Result<()> {

let output_zip_file_path: Cow<str> = if cli_options.in_place {
// Temporary file name in hte same directory (expecting that rename reuses file contents (& inodes))
let mut rng = ChaChaRng::from_entropy();
let mut rng = StdRng::from_entropy();
// I do not know the signal handling to remove the temporary file when interrupted
Cow::from(format!("{}.{:016x}.tmp", cli_options.input, rng.next_u64()))
} else {
Expand Down

0 comments on commit bd23319

Please sign in to comment.