From a9a11f486ecf632f0697228ef54abcac56a340ff Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 18 May 2024 10:04:48 +0200 Subject: [PATCH] hashsum: rename the blake2b algo with --tag + manage the different length --- src/uu/hashsum/src/hashsum.rs | 17 +++++++++++------ tests/by-util/test_hashsum.rs | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 961d4bb55..71923009e 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -59,7 +59,7 @@ struct Options { /// greater than 512. fn create_blake2b(matches: &ArgMatches) -> UResult<(&'static str, Box, usize)> { match matches.get_one::("length") { - Some(0) | None => Ok(("BLAKE2", Box::new(Blake2b::new()) as Box, 512)), + Some(0) | None => Ok(("BLAKE2b", Box::new(Blake2b::new()) as Box, 512)), Some(length_in_bits) => { if *length_in_bits > 512 { return Err(USimpleError::new( @@ -71,7 +71,7 @@ fn create_blake2b(matches: &ArgMatches) -> UResult<(&'static str, Box