Describe entropy program

This commit is contained in:
Neale Pickett 2018-01-09 16:42:14 +00:00
parent cd3d143d84
commit 495da32693
2 changed files with 15 additions and 0 deletions

View File

@ -9,6 +9,7 @@ TARGETS += unhex
TARGETS += pcat TARGETS += pcat
TARGETS += slice TARGETS += slice
TARGETS += hex TARGETS += hex
TARGETS += entropy
SCRIPTS += octets SCRIPTS += octets

View File

@ -145,6 +145,20 @@ In other words: you can feed `hex` output into `unhex` with no manipulations.
41 41
### entropy: compute shannon entropy
Displays the Shannon entropy of the input.
~/src/fluffy $ echo -n a | ./entropy
0.000000
~/src/fluffy $ echo -n aaaaaaaaa | ./entropy
0.000000
~/src/fluffy $ echo -n aaaaaaaaab | ./entropy
0.468996
~/src/fluffy $ echo -n aaaaaaaaabc | ./entropy
0.865857
### pyesc: python escape input ### pyesc: python escape input
Escapes input octets for pasting into a python "print" statement. Escapes input octets for pasting into a python "print" statement.