User Tools

Site Tools


syntax:functions:hmachex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
syntax:functions:hmachex [2020/10/31 14:24]
dmitry
syntax:functions:hmachex [2021/09/18 19:50] (current)
craigt
Line 1: Line 1:
-=====HMACHex(algorithm, text, key)=====+====== HMACHex(algorithm, text, key) =====
 +Category:  Web function
  
-Calculates a keyed hexadecimal hash of a given text value using one of the algorithms+\\  
-  * md5 +=====Description===== 
-  * sha1 +This function calculates a keyed hexadecimal hash of a given text value using one of the algorithms listed in the table, below.
-  * sha256 +
-  * sha384 +
-  * sha512+
  
-The specified algorithm is used as a Hash-based Message Authentication Code (HMAC). The HMAC process mixes a secret key with the message data, hashes the result with the hash function, mixes that hash value with the secret key again, and then applies the hash function a second time.+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|algorithm  | Text |The method to use to generate the hash from //text// See the table below. 
 +|text  |Text |The message data, combined with the //key// to generate the final hash value.  | 
 +|key|Text |The secret key mixed with //text// to generate the final hash value. 
 +**Return value type:** Text.
  
-Remarks: data types other than text are not converted into text automatically. All texts are assumed to have the UTF-8 encoding. The algorithm name is case-insensitive. The key and the value are case-sensitive.+\\  
 +^Algorithm  ^Notes 
 +|md5    | | 
 +|sha1 |  | 
 +|sha256    | | 
 +|sha384    | | 
 +|sha512    | |
  
-Example: +\\  
-^ Expression ^ Result ^ +=====Remarks===== 
-| hmachex("md5""223jh4gj2h3g4""We're just two lost souls swimming in fish bowl" | 9ab29e6486f1ff01d2cbb4238abc0320  |+The specified algorithm is used as a Hash-based Message Authentication Code (HMAC). The HMAC process mixes a secret key with the message datahashes the result with the hash functionmixes that hash value with the secret key again, and then applies the hash function second time.
  
 +Data types other than text are not converted into text automatically. All texts are assumed to have the UTF-8 encoding. The algorithm name is case-insensitive. The key and the value are case-sensitive.
  
-**See also**+\\  
 +=====Examples===== 
 +  hmachex('md5', '223jh4gj2h3g4', 'Two lost souls' //Returns 'fd59298c9f0c5a4b5e617bfefe418f02'
  
 +\\ 
 +=====See also=====
 +  * [[syntax:functions:hash|Hash(value)]]
   * [[syntax:functions:hashhex|HashHex(algorithm, value)]]   * [[syntax:functions:hashhex|HashHex(algorithm, value)]]
-  * [[syntax:functions:hash|Hash(value)]] 
- 
syntax/functions/hmachex.txt · Last modified: 2021/09/18 19:50 by craigt