@@ -18,10 +18,7 @@ use uucore::checksum::compute::{
1818use uucore:: checksum:: validate:: {
1919 ChecksumValidateOptions , ChecksumVerbose , perform_checksum_validation,
2020} ;
21- use uucore:: checksum:: {
22- AlgoKind , ChecksumError , SizedAlgoKind , calculate_blake2b_length_str,
23- sanitize_sha2_sha3_length_str,
24- } ;
21+ use uucore:: checksum:: { AlgoKind , ChecksumError , SizedAlgoKind , calculate_blake2b_length_str} ;
2522use uucore:: error:: UResult ;
2623use uucore:: line_ending:: LineEnding ;
2724use uucore:: { format_usage, translate} ;
@@ -72,36 +69,6 @@ fn create_algorithm_from_flags(matches: &ArgMatches) -> UResult<(AlgoKind, Optio
7269 if matches. get_flag ( "b2sum" ) {
7370 set_or_err ( ( AlgoKind :: Blake2b , None ) ) ?;
7471 }
75- if matches. get_flag ( "b3sum" ) {
76- set_or_err ( ( AlgoKind :: Blake3 , None ) ) ?;
77- }
78- if matches. get_flag ( "sha3" ) {
79- match matches. get_one :: < String > ( options:: LENGTH ) {
80- Some ( len) => set_or_err ( (
81- AlgoKind :: Sha3 ,
82- Some ( sanitize_sha2_sha3_length_str ( AlgoKind :: Sha3 , len) ?) ,
83- ) ) ?,
84- None => return Err ( ChecksumError :: LengthRequired ( "SHA3" . into ( ) ) . into ( ) ) ,
85- }
86- }
87- if matches. get_flag ( "sha3-224" ) {
88- set_or_err ( ( AlgoKind :: Sha3 , Some ( 224 ) ) ) ?;
89- }
90- if matches. get_flag ( "sha3-256" ) {
91- set_or_err ( ( AlgoKind :: Sha3 , Some ( 256 ) ) ) ?;
92- }
93- if matches. get_flag ( "sha3-384" ) {
94- set_or_err ( ( AlgoKind :: Sha3 , Some ( 384 ) ) ) ?;
95- }
96- if matches. get_flag ( "sha3-512" ) {
97- set_or_err ( ( AlgoKind :: Sha3 , Some ( 512 ) ) ) ?;
98- }
99- if matches. get_flag ( "shake128" ) {
100- set_or_err ( ( AlgoKind :: Shake128 , Some ( 128 ) ) ) ?;
101- }
102- if matches. get_flag ( "shake256" ) {
103- set_or_err ( ( AlgoKind :: Shake256 , Some ( 256 ) ) ) ?;
104- }
10572
10673 if alg. is_none ( ) {
10774 return Err ( ChecksumError :: NeedAlgorithmToHash . into ( ) ) ;
@@ -372,15 +339,7 @@ pub fn uu_app_custom() -> Command {
372339 ( "sha256" , translate ! ( "hashsum-help-sha256" ) ) ,
373340 ( "sha384" , translate ! ( "hashsum-help-sha384" ) ) ,
374341 ( "sha512" , translate ! ( "hashsum-help-sha512" ) ) ,
375- ( "sha3" , translate ! ( "hashsum-help-sha3" ) ) ,
376- ( "sha3-224" , translate ! ( "hashsum-help-sha3-224" ) ) ,
377- ( "sha3-256" , translate ! ( "hashsum-help-sha3-256" ) ) ,
378- ( "sha3-384" , translate ! ( "hashsum-help-sha3-384" ) ) ,
379- ( "sha3-512" , translate ! ( "hashsum-help-sha3-512" ) ) ,
380- ( "shake128" , translate ! ( "hashsum-help-shake128" ) ) ,
381- ( "shake256" , translate ! ( "hashsum-help-shake256" ) ) ,
382342 ( "b2sum" , translate ! ( "hashsum-help-b2sum" ) ) ,
383- ( "b3sum" , translate ! ( "hashsum-help-b3sum" ) ) ,
384343 ] ;
385344
386345 for ( name, desc) in algorithms {
0 commit comments