I got a packet from a UDP socket. The last 64 bytes of the packet are an RSA-512 SHA-256 digital signature.
Using struct.unpack()
I'm able to get it out into a string.
When I print the string, it looks like 'Output_1'
I want the string to look like 'Output_2'
from hashlib import sha256
h = sha256()
h.update("Some sample string here!")
print 'Output_1:', h.digest()
print 'Output_2:', h.hexdigest()
So, given the string that is the output of h.digest()
can it be loaded into hashlib.sha256()
and printed out like h.hexdigest()
?