Script Python convert string in base64 to hex

import sys
import base64
#import binascii</code>

#Controlamos que tenga argumento
print 'usage: &lt;DigestValue&gt;'

base64string = sys.argv[1]

print base64.decodestring(base64string).encode('hex')
#print binascii.a2b_base64(base64string).encode('hex')

The commented is an alternative way for conversion. I add link to gist snippet

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>