(PHP 4 >= 4.3.0, PHP 5, PHP 7)
sha1 — 锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷 sha1 散锟斤拷值
It is not recommended to use this function to secure passwords, due to the fast nature of this hashing algorithm. See the Password Hashing FAQ for details and best practices.
$str
[, bool $raw_output
= false
] ) : string锟斤拷锟斤拷» 锟斤拷锟斤拷锟斤拷全散锟斤拷锟姐法 1 锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷 sha1 散锟斤拷值锟斤拷
str
锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷
raw_output
锟斤拷锟斤拷锟窖★拷锟� raw_output
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为 TRUE
锟斤拷
锟斤拷么 sha1 摘要锟斤拷锟斤拷 20 锟街凤拷锟斤拷锟饺碉拷原始锟斤拷式锟斤拷锟截o拷
锟斤拷锟津返伙拷值锟斤拷一锟斤拷 40 锟街凤拷锟斤拷锟饺碉拷十锟斤拷锟斤拷锟斤拷锟斤拷锟街★拷
锟斤拷锟斤拷 sha1 散锟斤拷值锟街凤拷锟斤拷锟斤拷
Example #1 sha1() 锟斤拷锟斤拷
<?php
$str = 'apple';
if (sha1($str) === 'd0be2dc421be4fcd0172e5afceea3970e2f3d940') {
echo "Would you like a green or red apple?";
}
?>