User Tools

Site Tools


uphp:functions:sha1

This is an old revision of the document!


sha1($str)

Calculate the sha1 hash of a string. This can be used for cryptography or just for checksum calculations.

For more information on SHA1, see the Wikipedia link.

Example:

<pre>
<? 
// call the function with this: sha1.cgi?key=secretkey
 
// sha1 hash value for secretykey
$hash = "9885F8AF04289135DF259E34BD22D17FE45EA81E";
 
if (sha1($_GET['key']) == $hash) {
        print("hashes match!");
}
 
?>
</pre>
uphp/functions/sha1.1494915284.txt.gz · Last modified: 2021/09/13 05:56 (external edit)