binary rot right

This commit is contained in:
Christoph J. Scherr 2023-05-04 09:24:09 +02:00
parent 42571e7a0e
commit f453d2e0c7
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
1 changed files with 3 additions and 2 deletions

View File

@ -93,11 +93,12 @@ pub fn main() {
match action.action { match action.action {
BinaryActions::Rotate(bin_rot_args) => { BinaryActions::Rotate(bin_rot_args) => {
let result: u32; let result: u32;
dbg!(&bin_rot_args.left);
if bin_rot_args.left { if bin_rot_args.left {
result = binary::rotl32(bin_rot_args.base, bin_rot_args.shift_width); result = binary::rotl32(bin_rot_args.base, bin_rot_args.shift_width);
} }
else { 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 { if args.machine {
println!("{}", result) println!("{}", result)
@ -110,7 +111,7 @@ pub fn main() {
} }
// Fallback, this should ideally not execute
_ => { _ => {
eprintln!("Command not implemented.\n"); eprintln!("Command not implemented.\n");
} }