mrcrowbar.statistics module

class mrcrowbar.statistics.Stats(buffer: Union[bytes, bytearray, mmap.mmap, memoryview])[source]

Bases: object

Generate a Stats instance for a byte string and analyse the data.

ansi_format(width: int = 64, height: int = 12) → str[source]

Return a human readable ANSI-terminal printout of the stats.

width
Custom width for the graph (in characters).
height
Custom height for the graph (in characters).
entropy = None

Shanning entropy calculated for the source data.

histo = None

Byte histogram for the source data.

histogram(width: int) → list[int][source]
print(width: int = 64, height: int = 12)[source]

Print the graphical version of the results produced by ansi_format().