pub enum IoC {
En,
Pl,
Fr,
De,
It,
Pt,
Ru,
Es,
}Expand description
Index of coincidence
Choose which language to use
Variants§
Implementations§
Source§impl IoC
impl IoC
Sourcepub fn value(&self) -> f64
pub fn value(&self) -> f64
Return value of given IoC
This should be used for now for this crate.
The values were divided by 26 (number of english letters).
Pl values were calculated by me, the rest are from wikipedia
For normalized results, use value_normalized()
§Example
use cryptography_breaker::IoC;
let english_ioc_value = IoC::En.value();
assert_eq!(0.0665, english_ioc_value)Sourcepub fn value_normalized(&self) -> f64
pub fn value_normalized(&self) -> f64
Return normalized value of given IoC
The calculated values are normalized by multiply the results by number of letters
Pl values were calculated by me, the rest are from wikipedia
For normalized results, use value_normalized()
§Example
use cryptography_breaker::IoC;
let english_ioc_value_normalized = IoC::En.value_normalized();
assert_eq!(1.729, english_ioc_value_normalized)Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoC
impl RefUnwindSafe for IoC
impl Send for IoC
impl Sync for IoC
impl Unpin for IoC
impl UnsafeUnpin for IoC
impl UnwindSafe for IoC
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