pub struct CaesarDecoder;Expand description
The caesar decoder, call:
let caesar_decoder = Decoder::<caesarDecoder>::new() to create a new instance
And then call:
result = caesar_decoder.crack(input) to decode a caesar string
The struct generated by new() comes from interface.rs
use ares::decoders::caesar_decoder::CaesarDecoder;
use ares::decoders::interface::{Crack, Decoder};
use ares::checkers::{athena::Athena, CheckerTypes, checker_type::{Check, Checker}};
let decode_caesar = Decoder::<CaesarDecoder>::new();
let athena_checker = Checker::<Athena>::new();
let checker = CheckerTypes::CheckAthena(athena_checker);
let result = decode_caesar.crack("uryyb guvf vf ybat grkg", &checker).unencrypted_text;
assert!(result.is_some());
// If it succeeds, the 0th element is the plaintext else it'll contain 25 elements
// of unsuccessfully decoded text
assert_eq!(result.unwrap()[0], "hello this is long text");Auto Trait Implementations§
impl Freeze for CaesarDecoder
impl RefUnwindSafe for CaesarDecoder
impl Send for CaesarDecoder
impl Sync for CaesarDecoder
impl Unpin for CaesarDecoder
impl UnsafeUnpin for CaesarDecoder
impl UnwindSafe for CaesarDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more