array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.sha1-file.php', 1 => 'sha1_file', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'String 関数', ), 'prev' => array ( 0 => 'function.setlocale.php', 1 => 'setlocale', ), 'next' => array ( 0 => 'function.sha1.php', 1 => 'sha1', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/strings/functions/sha1-file.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
sha1_file — ファイルの sha1 ハッシュを計算する
» US Secure Hash Algorithm 1 を使用して
filename
の sha1 ハッシュを計算し、そのハッシュを
返します。ハッシュは 40 文字の 16 進数となります。
成功した場合に文字列、それ以外の場合に false
を返します。
例1 sha1_file() の例
<?php
foreach(glob('/home/Kalle/myproject/*.php') as $ent)
{
if(is_dir($ent))
{
continue;
}
echo $ent . ' (SHA1: ' . sha1_file($ent) . ')', PHP_EOL;
}
?>