mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #3174 from alextibbles/hashsum-update-hex
hashsum: update hex to 0.4.3
This commit is contained in:
commit
38bcafb7c2
4 changed files with 7 additions and 7 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -957,9 +957,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex"
|
name = "hex"
|
||||||
version = "0.2.0"
|
version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa"
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex-literal"
|
name = "hex-literal"
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/hashsum.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
digest = "0.10.1"
|
digest = "0.10.1"
|
||||||
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
hex = "0.2.0"
|
hex = "0.4.3"
|
||||||
libc = "0.2.42"
|
libc = "0.2.42"
|
||||||
memchr = "2"
|
memchr = "2"
|
||||||
md5 = "0.3.5"
|
md5 = "0.3.5"
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern crate sha3;
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
use hex::ToHex;
|
use hex::encode;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use memchr::memmem;
|
use memchr::memmem;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ pub trait Digest {
|
||||||
fn result_str(&mut self) -> String {
|
fn result_str(&mut self) -> String {
|
||||||
let mut buf: Vec<u8> = vec![0; self.output_bytes()];
|
let mut buf: Vec<u8> = vec![0; self.output_bytes()];
|
||||||
self.result(&mut buf);
|
self.result(&mut buf);
|
||||||
buf.to_hex()
|
encode(buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ use self::digest::Digest;
|
||||||
use self::digest::DigestWriter;
|
use self::digest::DigestWriter;
|
||||||
|
|
||||||
use clap::{App, AppSettings, Arg, ArgMatches};
|
use clap::{App, AppSettings, Arg, ArgMatches};
|
||||||
use hex::ToHex;
|
use hex::encode;
|
||||||
use md5::Context as Md5;
|
use md5::Context as Md5;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use sha1::Sha1;
|
use sha1::Sha1;
|
||||||
|
@ -652,6 +652,6 @@ fn digest_reader<T: Read>(
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
bytes.resize((output_bits + 7) / 8, 0);
|
bytes.resize((output_bits + 7) / 8, 0);
|
||||||
digest.result(&mut bytes);
|
digest.result(&mut bytes);
|
||||||
Ok(bytes.to_hex())
|
Ok(encode(bytes))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue