Hi Every one,
I have a perl script which uses the following code to decode the username saved in a cookie. I want to parse that cookie in php for adding some more features in the application. The source application in perl but I don't know any thing about perl. Here is the code ...
Can any one help me to convert this code in PHP?
Thanks in advance
I have a perl script which uses the following code to decode the username saved in a cookie. I want to parse that cookie in php for adding some more features in the application. The source application in perl but I don't know any thing about perl. Here is the code ...
Code:
@table = (('A' .. 'Z'), ('a' .. 'z'), ('0' .. '9'), '+', '/', '|');
for ($_ = 0; $_ <= $#table; $_++) {
$decode_table[ord($table[$_])] = $_;
}
local $_ = $_[0];
s/./unpack('B6', chr($decode_table[ord($&)] << 2))/eg;
pack('B' . (int(length($_) / 8) * 8), $_);
Thanks in advance

Comment