PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > php and perl md5
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
php and perl md5

Réponse
 
LinkBack Outils de la discussion
Vieux 13/06/2008, 02h45   #1
jason m
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut php and perl md5

I am wondering how to translate this perl code to php. It seems the
md5 function is the same when using hexadecimal in perl but I'm not
sure what this md5->add code does.

Perl:
my $md5ShopPassString = Digest::MD5->new;
$md5ShopPassString->add("$ShopId");
$md5ShopPassString->add("$OrderId");
$ShopPassString = $md5ShopPassString->hexdigest;

PHP:
md5($ShopId . $OrderId);

These are not equal. Thanks in advance for any .

  Réponse avec citation
Vieux 13/06/2008, 03h54   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php and perl md5

jason m wrote:
> I am wondering how to translate this perl code to php. It seems the
> md5 function is the same when using hexadecimal in perl but I'm not
> sure what this md5->add code does.
>
> Perl:
> my $md5ShopPassString = Digest::MD5->new;
> $md5ShopPassString->add("$ShopId");
> $md5ShopPassString->add("$OrderId");
> $ShopPassString = $md5ShopPassString->hexdigest;
>
> PHP:
> md5($ShopId . $OrderId);
>
> These are not equal. Thanks in advance for any .
>
>


I'd suggest you find out what the md5->add function does before trying
to convert it. Try a perl newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 13/06/2008, 13h00   #3
C. (http://symcbean.blogspot.com/)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php and perl md5

On Jun 13, 3:54 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> jason m wrote:
> > I am wondering how to translate this perl code to php. It seems the
> > md5 function is the same when using hexadecimal in perl but I'm not
> > sure what this md5->add code does.

>

<snip>
>
> I'd suggest you find out what the md5->add function does before trying
> to convert it. Try a perl newsgroup.
>


Not suprisingly it concatenates it.

> > Perl:
> > my $md5ShopPassString = Digest::MD5->new;
> > $md5ShopPassString->add("$ShopId");
> > $md5ShopPassString->add("$OrderId");
> > $ShopPassString = $md5ShopPassString->hexdigest;

>
> > PHP:
> > md5($ShopId . $OrderId);

>
> > These are not equal. Thanks in advance for any .


If they really aren't the same (you didn't provide examples) then try
using the Base64 method in Perl.
But as Jerry points out we're getting OT here.

C.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h23.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08907 seconds with 11 queries