security.crypto package

public function getCRC32(any content) returns (string)

Returns the CRC32 hash for the provided element. Currently supports strings and blobs.

Parameter Name Data Type Description
content any The content to be hashed

Return Variable Data Type Description
string The generated hash

public function getHash(string baseString, Algorithm algorithm) returns (string)

Returns the hash of the given string using the specified algorithm.

Parameter Name Data Type Description
baseString string The string to be hashed
algorithm Algorithm The hashing algorithm to be used

Return Variable Data Type Description
string The hashed string

public function getHmac(string baseString, string keyString, Algorithm algorithm) returns (string)

Returns the HMAC value of the provided base string.

Parameter Name Data Type Description
baseString string The string to be hashed
keyString string The key string
algorithm Algorithm The hashing algorithm to be used

Return Variable Data Type Description
string The hashed string

public enum Algorithm

The algorithms which can be used in crypto functions.

Name Description
SHA1 SHA1 algorithm
SHA256 SHA256 algorithm
MD5 MD5 algorithm