You are here: pack and unpack problems. « PHP Programming Language « IT news, forums, messages
pack and unpack problems.

Posted by Steve on 11/29/06 04:04

Are there any gurus of the pack/unpack world out there that can help me
with this one?

I have an encrypted string which I'm reading from a zipped file. It was
written using

pack ( "la" . strlen (encrypted), strlen (encrypted), strlen (encrypted))

most of the time, it decrypts correctly when I unpack as...

list (, $Len ) = unpack ("l", gzread($ZipFile, 4));
$temp = unpack ( "C".$Len, gzread($ZipFile, $Len));

....except when it doesn't. I have no control over the format of the file,
so can't change that. My gut feeling is that the problems are caused by
the 'a' flag used to write it, which may be adding nulls to the string.

Anyone got any ideas what I'm doing wrong??

Cheers, Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация