I don't know perl and need to convert this to PHP4.
If this simply a standard MD5 hash? md5()
Any help would be apreciated.
sub mymd5
{
my $x = $user . $password . $_[0] ;
my @mat ;
my $b = $x ;
for $i (0 .. length($x)/2)
{
push @mat,repeater($b) ;
$b = substr($b,1,length($b)-1) ;
}
my $c = '' ;
for $j ( 0 .. 127)
{
for $i (0 .. length($x)/2)
{
$c .= substr($mat[$i],$j,1) ;
}
}
$c1 = substr($c,0,length($c)/2) ;
$c2 = substr($c,length($c)/2+1,length($c)) ;
$result = '' ;
for $i ( 0 .. length($c)/2)
{
$x = substr($c1,$i,1) ;
$y = substr($c2,$i,1) ;
$result .= ((ord($x)3+ord($y)7) % 11) % 10 ;
}
substr($result,length($result)/3,32) ;
}
sub repeater
{
my $x = shift ;
my $b = $x ;
while (length($b) < 128)
{
$b .= $b ;
}
substr($b,0,128) ;
}