|
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]
|