From f453d2e0c7a5fdadd940d8bd794e98f5426b74fc Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Thu, 4 May 2023 09:24:09 +0200 Subject: [PATCH] binary rot right --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5b9fb06..dfe3a02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,11 +93,12 @@ pub fn main() { match action.action { BinaryActions::Rotate(bin_rot_args) => { let result: u32; + dbg!(&bin_rot_args.left); if bin_rot_args.left { result = binary::rotl32(bin_rot_args.base, bin_rot_args.shift_width); } else { - result = binary::rotl32(bin_rot_args.base, bin_rot_args.shift_width); + result = binary::rotr32(bin_rot_args.base, bin_rot_args.shift_width); } if args.machine { println!("{}", result) @@ -110,7 +111,7 @@ pub fn main() { } - + // Fallback, this should ideally not execute _ => { eprintln!("Command not implemented.\n"); }