Created
January 3, 2019 18:47
-
-
Save dsandler/dcf8095de610364d6d84e5e407937419 to your computer and use it in GitHub Desktop.
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
# basic hex dumper | |
def xxd(data): | |
s = '' | |
for i in range(len(data)): | |
if i % 16 == 0: s += '%08x: ' % i | |
s += '%02x' % ord(data[i]) | |
if i % 16 == 15: s += '\n' | |
elif i % 2 == 1: s += ' ' | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment