You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== sha1 ==
[[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
Copy Code
The output would be:
Copy Code
The output would be:
Returns the sha1 hash of the specified string or byte array. Note that sha1 is considered no more secure than md5, and should not be used in a security context. sha-256 should be used instead for storing sensitive data. It is a one way hashing algorithm. This function is aware of and compatible with secure_string.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| sha1
|-
! scope="row" | Returns
| string
|-
! scope="row" | Usages
| val
|-
! scope="row" | Throws
| [[../objects/ms.lang.PluginInternalException|ms.lang.PluginInternalException]]
|-
! scope="row" | Since
| 3.3.0
|-
! scope="row" | Restricted
| No
|-
! scope="row" | Optimizations
| [[../../Optimizer#CONSTANT_OFFLINE|CONSTANT_OFFLINE]] [[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
sha1(val)=== Examples === ====Example 1==== Basic usage Given the following code:
sha1('string')

1 {{function|sha1}}('string')
:ecb252044b5ea0f679ee78ec1a12904739e2904d====Example 2==== Basic usage Given the following code:
sha1('String')

1 {{function|sha1}}('String')
:3df63b7acb0522da685dad5fe84b81fdd7b25264
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)