pub struct EntropyMetrics {
pub shannon_entropy: f64,
pub min_entropy: f64,
pub collision_entropy: f64,
pub chi_squared: f64,
pub chi_squared_p: f64,
pub serial_correlation: f64,
pub longest_run: usize,
pub bit_bias: f64,
pub unique_bytes: usize,
}Expand description
Comprehensive entropy metrics for a byte sequence.
Fields§
§shannon_entropy: f64Shannon entropy in bits per byte (0.0–8.0, 8.0 = perfectly random).
min_entropy: f64Min-entropy in bits per byte (most conservative estimate).
collision_entropy: f64Collision entropy (Renyi order-2) in bits per byte.
chi_squared: f64Chi-squared test statistic.
chi_squared_p: f64Chi-squared p-value (1.0 = perfectly uniform).
serial_correlation: f64Serial correlation coefficient (-1.0 to 1.0, 0.0 = uncorrelated).
longest_run: usizeLongest run of identical bits.
bit_bias: f64Fraction of bits that are 1 (should be ~0.5).
unique_bytes: usizeNumber of unique bytes observed.
Trait Implementations§
Source§impl Clone for EntropyMetrics
impl Clone for EntropyMetrics
Source§fn clone(&self) -> EntropyMetrics
fn clone(&self) -> EntropyMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EntropyMetrics
impl RefUnwindSafe for EntropyMetrics
impl Send for EntropyMetrics
impl Sync for EntropyMetrics
impl Unpin for EntropyMetrics
impl UnsafeUnpin for EntropyMetrics
impl UnwindSafe for EntropyMetrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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