Definition
The sha1() function calculates the SHA-1 hash of a string.
Syntax
sha1(string, raw)
Parameters
Parameter | Description |
---|---|
string |
Required. The string to be calculated. |
raw |
Optional. Specify hex or binary output format:true - Raw 20 character binary formatfalse - Default. 40 character hex number |
Example
<?php
$hello = "Hello World!";
echo sha1($hello);