[−][src]Function tink_tests::z_test_uniform_string
pub fn z_test_uniform_string(bytes: &[u8]) -> Result<(), TinkError>
Use a z test on the given byte string, expecting all bits to be uniformly set with probability 1/2. Returns non ok status if the z test fails by more than 10 standard deviations.
With less statistics jargon: This counts the number of bits set and expects the number to be roughly half of the length of the string. The law of large numbers suggests that we can assume that the longer the string is, the more accurate that estimate becomes for a random string. This test is useful to detect things like strings that are entirely zero.
Note: By itself, this is a very weak test for randomness.