Unpacking binary data with struct.unpack
Grant Edwards
nobody at nowhere.nohow
Sat Aug 12 11:35:37 EDT 2000
In article <ok53n8.lu1.ln at odin.hmf.de>, Holger Fuessler wrote:
>> As far as values embedded within the payload (which neither TCP nor IP
>> understand nor care about), then as you say any order can be used -
>> it's up to the applications creating and processing the data.
>
>Is there an internet standard for this?
For what?
>The RFC868 only says it's a 4-byte integer and nothing more. Decoding the 4
>bytes with network decoding (using !i in the unpack string) gives me an
>integer, but it's not - as far as I understand the RFC - in the right scale.
I thought we were talking about the payload -- the payload is a stream of
8-bit bytes (octets). There is no organization or interpretation implied
for the payload data.
>Has anybody a routine that gives a binary view of a python integer (like
>01110101). Maybe I could figure out the encoding that way.
--
Grant Edwards grante Yow! Hey, I LIKE that
at POINT!!
visi.com
More information about the Python-list
mailing list