This is an old revision of the document!
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>