Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- def ByteToHex(byteStr): return '%02X' % ord(byteStr)
- try:
- counter = {}
- for bytes in open(sys.argv[1], "rb").read():
- counter[ByteToHex(bytes)] = counter.get(ByteToHex(bytes), 0) + 1
- peak = max(counter.values())
- for key, value in sorted(counter.items(), key=lambda x:(x)):
- print '%s: %06d %s' % (key, value, '-' * (68 * value/peak))
- except Exception, e:
- print e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement