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.)
== hmac_sha256 ==
[[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
Copy Code
The output would be:
Returns the sha256 HMAC of the specified value using the provided key. If the key or value is not a byte array, it will be converted to a byte array through its UTF-8 string representation. 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
| hmac_sha256
|-
! scope="row" | Returns
| string
|-
! scope="row" | Usages
| key, val
|-
! scope="row" | Throws
| [[../objects/ms.lang.PluginInternalException|ms.lang.PluginInternalException]]
|-
! scope="row" | Since
| 3.3.1
|-
! scope="row" | Restricted
| No
|-
! scope="row" | Optimizations
| [[../../Optimizer#CONSTANT_OFFLINE|CONSTANT_OFFLINE]] [[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
hmac_sha256(key, val)=== Examples === ====Example 1==== Basic usage Given the following code:
hmac_sha256('secret_key', 'string')

1 {{function|hmac_sha256}}('secret_key', 'string')
:0b08ba25714e448257e6bcf9731b044278ec5cb71403033b3a415f6c5dcc3507
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.)