English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String Character String Functions Manual
sha1() function is used to calculate the sha of the string1 Hash Value.
string sha1 ( string $str[, bool $raw_output = false ] )
Used to calculate the sha of the string1 Hash Value.
It returns the sha1 Hash Value.
Serial Number | Parameters and Description |
---|---|
1 | str (required) Input string. |
2 | raw_output Optional. If the raw_output parameter is set to TRUE, then sha1 The digest will be 20 character length raw format returned, otherwise the return value is a 40 character length hexadecimal number |
Try the following example, calculate the URL string "oldtoolbag.com" hash value:
<?php //Calculate the URL string "oldtoolbag.com" hash value: $input = "oldtoolbag.com"; echo sha1($input); ?>Test and see‹/›
Output Result
4ba7014d345010557e9ac4ed7d8c3e1c6b1e3d36