[][src]Function upwd::calculate_entropy

pub fn calculate_entropy(length: usize, pool_size: usize) -> f64

Calculates entropy. Returns f64::NEG_INFINITY if pool_size is 0

Examples

let entropy = upwd::calculate_entropy(12, 64);

assert_eq!(entropy, 72.0);

Panics

Panics when casting BigUint to f64. This usually means that the entropy will be greater than 1024 bits.