Hmac

Creates an algorithmic hash of an object

Method Signature

Hmac(input=[any], key=[any], algorithm=[string], encoding=[string], numIterations=[integer])

Arguments

Argument
Type
Required
Description
Default

input

any

true

The item to be hashed

key

any

true

algorithm

string

false

The supported {@link java.security.MessageDigest} algorithm (case-insensitive)

HmacMD5

encoding

string

false

Applicable to strings ( default "utf-8" )

utf-8

numIterations

integer

false

1

Examples

Example HMAC Using HMACSHA256

Run Example

hmac( "msg", "secret", "HMACSHA256" );

Result: fe4f9c418f683f034f6af90d1dd5b86ac0355dd96332c59cc74598d0736107f6

Additional Examples

Run Example

Last updated

Was this helpful?