Re: [PHP] BigEndian to integer

2003-07-15 Thread Gerard Samuel
Tom Rogers wrote: Trying to use unpack by itself on large binary streams with variable packet sizes and content buried in them can become a nightmare. Try to unscramble an excel file using unpack() :) Yeah, not exactly the most exciting thing to do. As long as I have some specs on the format, it

Re: [PHP] BigEndian to integer

2003-07-15 Thread Gerard Samuel
Joel Rees wrote: Just in case you're still groggy when you wake up this morning, the page for pack() lists an 'N' format for unsigned long big endian byte order for pack() and unpack(). I think what you probably want to do most is use the 'N' format when you unpack. (The other responses were amusi

Re: [PHP] BigEndian to integer

2003-07-15 Thread Joel Rees
> > http://www.php.net/pack > > A little background on what Im doing. Im attempting to read realaudio > files for their metadata, so Im reading from a binary string, > and Im currently using unpack() (Im new to using this function, so I may > be wrong with its usage) to unpack the data, along

Re: [PHP] BigEndian to integer

2003-07-14 Thread Tom Rogers
Hi, Monday, July 14, 2003, 6:00:04 PM, you wrote: GS> A bit off topic GS> Im trying to figure out how to convert BigEndian byte words to integers. For example ->> GS> 0 0 0 18 = 18 GS> The only way I know how to convert this is by writing down on paper, and GS> writing 8 4 2 1 above the numbe

Re: [PHP] BigEndian to integer

2003-07-14 Thread Gerard Samuel
Marek Kilimajer wrote: http://www.php.net/pack A little background on what Im doing. Im attempting to read realaudio files for their metadata, so Im reading from a binary string, and Im currently using unpack() (Im new to using this function, so I may be wrong with its usage) to unpack the da

Re: [PHP] BigEndian to integer

2003-07-14 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Mon, 14 Jul 2003 at 09:00, lines prefixed by '>' were originally written by you. > A bit off topic > Im trying to figure out how to convert BigEndian byte words to > integers. > For example -> > 0 0 0 18 = 18 > The only way I know how to con

Re: [PHP] BigEndian to integer

2003-07-14 Thread Marek Kilimajer
http://www.php.net/pack Gerard Samuel wrote: A bit off topic Im trying to figure out how to convert BigEndian byte words to integers. For example -> 0 0 0 18 = 18 The only way I know how to convert this is by writing down on paper, and writing 8 4 2 1 above the numbers and adding up the value