[][src]Function tink_tests::z_test_autocorrelation_uniform_string

pub fn z_test_autocorrelation_uniform_string(
    bytes: &[u8]
) -> Result<(), TinkError>

Test whether the autocorrelation of a string points to the bits being independent and uniformly distributed. Rotates the string in a cyclic fashion. Returns non ok status if the z test fails by more than 10 standard deviations.

With less statistics jargon: This rotates the string bit by bit and performs z_test_crosscorrelation_uniform_strings on each of the rotated strings and the original. This will find self similarity of the input string, especially periodic self similarity. For example, it is a decent test to find English text (needs about 180 characters with the current settings).

Note: Having a correlation of zero is only a necessary but not sufficient condition for independence.