Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import binascii
- def binencode(data):
- try:
- return bin(int(binascii.hexlify(data), 16)).replace('b','')
- except:
- return None
- print "Error"
- def bindecode(data):
- try:
- n = int(data, 2)
- return binascii.unhexlify('%x' % n)
- except:
- return None
- print "Error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement