[−][src]Struct bacon_cipher::codecs::char_codec::CharCodecV2
A codec that encodes data of type char
.
The encoding is done by substituting with two given elements (elem_a
and elem_b
) of type T
.
The substitution is done using the second version of the Bacon's cipher.
Implementations
impl<T> CharCodecV2<T>
[src]
pub fn new(elem_a: T, elem_b: T) -> CharCodecV2<T>
[src]
Create a new CharCodec
using elements elem_a
and elem_b
for substitution.
Trait Implementations
impl<T: PartialEq + Clone> BaconCodec for CharCodecV2<T>
[src]
type ABTYPE = T
The type of the substitution characters A and B that produce a cipher output like ABABBBABBABAAABAABAAAAABABAAAAAABAABAABAABABBAABAABAAABBAAABAAAAAAABBAAABAA Read more
type CONTENT = char
The type of the content to be encoded to or decoded.
fn encode_elem(&self, elem: &char) -> Vec<T>
[src]
fn decode_elems(&self, elems: &[T]) -> char
[src]
fn a(&self) -> T
[src]
fn b(&self) -> T
[src]
fn encoded_group_size(&self) -> usize
[src]
fn is_a(&self, elem: &T) -> bool
[src]
fn is_b(&self, elem: &T) -> bool
[src]
fn encode(&self, input: &[Self::CONTENT]) -> Vec<Self::ABTYPE>
[src]
fn decode(&self, input: &[Self::ABTYPE]) -> Vec<Self::CONTENT>
[src]
impl<T: Clone> Clone for CharCodecV2<T>
[src]
fn clone(&self) -> CharCodecV2<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for CharCodecV2<char>
[src]
fn default() -> CharCodecV2<char>
[src]
A CharCodec
with CONTENT=char
, A='A'
and B='B'
It encodes the following secret:
['M', 'y', ' ', 's', 'e', 'c', 'r', 'e', 't']
is
To: ['a', 'b', 'a', 'b', 'b', 'b', 'a', 'b', 'b', 'a', 'b', 'a', 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'a', 'b', 'a']
impl<T: PartialEq> PartialEq<CharCodecV2<T>> for CharCodecV2<T>
[src]
fn eq(&self, other: &CharCodecV2<T>) -> bool
[src]
fn ne(&self, other: &CharCodecV2<T>) -> bool
[src]
impl<T> StructuralPartialEq for CharCodecV2<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for CharCodecV2<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for CharCodecV2<T> where
T: Send,
T: Send,
impl<T> Sync for CharCodecV2<T> where
T: Sync,
T: Sync,
impl<T> Unpin for CharCodecV2<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for CharCodecV2<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,