Hash
Creates an algorithmic hash of an object
Method Signature
Hash(input=[any], algorithm=[string], encoding=[string], numIterations=[integer])Arguments
Argument
Type
Required
Description
Default
input
any
true
The item to be hashed
algorithm
string
false
The supported {@link java.security.MessageDigest} algorithm (case-insensitive) or "quick" for an insecure 64-bit hash
MD5
encoding
string
false
Applicable to strings ( default "utf-8" )
utf-8
numIterations
integer
false
1
Examples
SHA-256 Hash Example
Returns 64 character hex result.
hash( "something", "SHA-256", "UTF-8" );
Result: 3fc9b689459d738f8c88a3a48aa9e33542016b7a4052e001aaa536fca74813cb
MD5 Hash Example
MD5 is not recommended for use requiring security.
Result: 437b930db84b8079c2dd804a71936b5f
Additional Examples
Related
Last updated
Was this helpful?
