User Tools

Site Tools


uphp:functions:sha1

This is an old revision of the document!


sha1

WMPRO, WMMINI FW >= 1.1015 WMMEGA FW >= 2.0

Calculate the SHA1 hash of a string

Description

string sha1 ( string $input )

This can be used for cryptography or just for checksum calculations.

For more information on SHA1, see this Wikipedia link.

Parameter

$input: A string

Return Values

String: SHA1 hash (40 character hexadecimal number) of input

Example

<?
  // Name this example and call it with this: sha1.cgi?key=secretkey
 
  // SHA1 hash value for "secretkey":
  $hash="9885F8AF04289135DF259E34BD22D17FE45EA81E";
 
  if (sha1($_GET['key']) == $hash) {
    print("hashes match!");
  }
?>

See Also

md5() - Calculate the MD5 hash of a string

md5_file() - Calculate the MD5 hash of a file

uphp/functions/sha1.1495822970.txt.gz · Last modified: 2021/09/13 05:56 (external edit)