📄 function.sha1-file.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Calculate the sha1 hash of a file</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.setlocale.html">setlocale</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.sha1.html">sha1</a></div> <div class="up"><a href="ref.strings.html">String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.sha1-file" class="refentry"> <div class="refnamediv"> <h1 class="refname">sha1_file</h1> <p class="verinfo">(PHP 4 >= 4.3.0, PHP 5, PECL hash:1.1-1.3)</p><p class="refpurpose"><span class="refname">sha1_file</span> — <span class="dc-title">Calculate the sha1 hash of a file</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><b><b>sha1_file</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filename</tt></span> [, <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$raw_output</tt></span> ] )</div> <p class="simpara"> Calculates the sha1 hash of <i><tt class="parameter">filename</tt></i> using the <a href="http://www.faqs.org/rfcs/rfc3174" class="link external">» US Secure Hash Algorithm 1</a>, and returns that hash. The hash is a 40-character hexadecimal number. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">filename</tt></i></span> <dd> <p class="para"> The filename </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">raw_output</tt></i></span> <dd> <p class="para"> When <b><tt>TRUE</tt></b>, returns the digest in raw binary format with a length of 20. Defaults to <b><tt>FALSE</tt></b>. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a string on success, <b><tt>FALSE</tt></b> otherwise. </p> </div> <div class="refsect1 changelog"> <h3 class="title">ChangeLog</h3> <p class="para"> <table class="informaltable"> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Version</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">5.0.0</td> <td colspan="1" rowspan="1" align="left"> Added the <i><tt class="parameter">raw_output</tt></i> parameter </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">5.1.0</td> <td colspan="1" rowspan="1" align="left"> Changed the function to use the streams API. It means that you can use it with wrappers, like <i>sha1_file('http://example.com/..')</i> </td> </tr> </tbody> </colgroup> </table> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.sha1.html" class="function" rel="rdfs-seeAlso">sha1()</a></li> <li class="member"><a href="function.md5-file.html" class="function" rel="rdfs-seeAlso">md5_file()</a></li> <li class="member"><a href="function.crc32.html" class="function" rel="rdfs-seeAlso">crc32()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.setlocale.html">setlocale</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.sha1.html">sha1</a></div> <div class="up"><a href="ref.strings.html">String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -