md5

(PHP 4, PHP 5, PHP 7, PHP 8)

md5Bir dizgenin md5 özetini hesaplar

Uyarı

Bu aşlama algoritmasının hızlı doğasından dolayı bu işlevin parolaları güvenli kılmak için kullanılması önerilmez. Ayrıntılar ve daha iyi uygulamalar için SSS: Parola Aşlama belgesine bakılabilir.

Açıklama

md5(string $dizge, bool $ikil = false): string

dizge dizgesinin MD5 özetini » RSA Data Security, Inc. MD5 İleti Özeti Algoritmasını kullanarak hesaplar ve bu özeti döndürür.

Bağımsız Değişkenler

dizge

Özeti hesaplanacak dizge.

ikil

İsteğe bağlı bu bağımsız değişkende true belirtirseniz MD5 özeti 16 bayt uzunlukta ham ikil biçemli bir dizge olarak döner.

Dönen Değerler

İleti aşını 32 haneli onaltılık sayısal dizge olarak olarak döndürür.

Örnekler

Örnek 1 - md5() örneği

<?php
$str
= 'apple';

if (
md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {
echo
"Yeşil elma mı istersin kırmızı mı?";
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes 2 notes

up
15
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]+$/.
up
5
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.
To Top