note 92846 deleted from function.strlen by danbrown
| From: | danbrown@php.net | Date: | Mon, 24 Aug 2009 17:01:57 +0000 |
| Subject: | note 92846 deleted from function.strlen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159835@lists.php.net to get a copy of this message | ||
Note Submitter: Adorjan
----
I noticed something odd when I use strlen to count my hash size. He will always return the bit size
of the hash, not the character size.
Example:
$text = hash("sha512",md5("some text"));
echo strlen($text);
It will show 128, which is actually the strength in bit for sha512, or something like that, but it
is not the character size. Sha512 have 95 characters.
I don't know why this thing happens when strlen is used on hash, but on everything else (normal
string) it works as he needs to, which means, he counts how many characters are there.
I hope I helped somebody with this. :-)