Avertissement
Il n'est pas recommandé d'utiliser cette fonction pour sécuriser les mots de passe, en raison de la nature
rapide de cet algorithme de hachage. Voir
F.A.Q du hachage des
mots de passe
pour plus de détails et les bonnes pratiques.
Calcule le MD5 de la chaîne de caractères
string
en
utilisant l'algorithme
»
RSA Data
Security, Inc. MD5 Message-Digest Algorithm
,
et retourne le résultat.
Si le paramètre optionnel
binary
est défini
à
true
, alors le md5 est retourné au format binaire brut avec une
longueur de 16.
yiminrong at yahoo dot ca
¶
3 years ago
Regarding Ray Paseur's comment, the strings hash to:
0e462097431906509019562988736854
0e830400451993494058024219903391
The odds of getting a hash exactly matching the format /^0+e[0-9]+$/ are not high but are also not negligible.
It should be added as a general warning for all hash functions to always use the triple equals === for comparison.
Actually, the warning should be in the operators section when comparing string values! There are lots of warnings about string comparisons, but nothing specific about the format /^0+e[0-9]+$/.
Ray.Paseur sometimes uses Gmail
¶
5 years ago
md5('240610708') == md5('QNKCDZO')
This comparison is true because both md5() hashes start '0e' so PHP type juggling understands these strings to be scientific notation. By definition, zero raised to any power is zero.