diff --git a/Cargo.lock b/Cargo.lock index 2480740..21b67e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -703,7 +703,7 @@ dependencies = [ "locale_config", "locale_name_code_page", "oem_cp", - "rand_chacha", + "rand", "regex", "rusty-hook", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 23765a4..466dabd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/bin/zifu.rs b/src/bin/zifu.rs index 76cce4f..134880a 100644 --- a/src/bin/zifu.rs +++ b/src/bin/zifu.rs @@ -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}; @@ -272,7 +272,7 @@ fn main() -> anyhow::Result<()> { let output_zip_file_path: Cow = 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 {