Hey there!
I'm trying to convert a big-endian 2 byte string into a numeric port number. I've already got some code, but I have no idea if it's right:
from struct import unpack
def unpack_port(big_endian-port):
return unpack("!H", big_endian-port)[0]
The port (using Python repr() ) is \x1a\xe1, and I get 6881 out of that function.
Is that correct?