This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def approximate_entropy(self, bin_data: str, pattern_length=10): | |
""" | |
Note that this description is taken from the NIST documentation [1] | |
[1] http://csrc.nist.gov/publications/nistpubs/800-22-rev1a/SP800-22rev1a.pdf | |
As with the Serial test of Section 2.11, the focus of this test is the frequency of all possible overlapping | |
m-bit patterns across the entire sequence. The purpose of the test is to compare the frequency of overlapping | |
blocks of two consecutive/adjacent lengths (m and m+1) against the expected result for a random sequence. | |
:param bin_data: a binary string |