pub struct Base64URLDecoder;
Expand description
The base64_url decoder, call:
let base64_url_decoder = Decoder::<Base64URLDecoder>::new()
to create a new instance
And then call:
result = base64_url_decoder.crack(input)
to decode a base64_url string
The struct generated by new() comes from interface.rs
use ares::decoders::base64_url_decoder::{Base64URLDecoder};
use ares::decoders::interface::{Crack, Decoder};
use ares::checkers::{athena::Athena, CheckerTypes, checker_type::{Check, Checker}};
let decode_base64_url = Decoder::<Base64URLDecoder>::new();
let athena_checker = Checker::<Athena>::new();
let checker = CheckerTypes::CheckAthena(athena_checker);
let result = decode_base64_url.crack("aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS8_ZXhhbXBsZT10ZXN0", &checker).unencrypted_text;
assert!(result.is_some());
assert_eq!(result.unwrap()[0], "https://www.google.com/?example=test");
Auto Trait Implementations§
impl Freeze for Base64URLDecoder
impl RefUnwindSafe for Base64URLDecoder
impl Send for Base64URLDecoder
impl Sync for Base64URLDecoder
impl Unpin for Base64URLDecoder
impl UnwindSafe for Base64URLDecoder
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