BE_MessageDigest
BE_MessageDigest ( text {; algorithm ; encoding } )
Returns a hash value generated by the MD5 or SHA functions from the text given, and optional encoding.
Version : 1.2
Version : 3.0 : added the optional encoding parameter.
Parameters :
text : the text to process.
algorithm ( optional ) : The type of hashing function to use. Default is to use BE_MessageDigestAlgorithmSHA256.
encoding ( optional ) : Possible values are BE_EncodingHex or BE_EncodingBase64 with no encoding being the default.
Result : the output of the hash function specified.
Possible values for the DigestType are, and their numeric equivalents :
BE_MessageDigestAlgorithmMD5 1
BE_MessageDigestAlgorithmSHA256 2
BE_MessageDigestAlgorithmMDC2 4
BE_MessageDigestAlgorithmSHA 6 BE_MessageDigestAlgorithmSHA1 7 BE_MessageDigestAlgorithmSHA224 8 BE_MessageDigestAlgorithmSHA384 9 BE_MessageDigestAlgorithmSHA512 10
Possible values for the Encoding and their numeric equivalents :
BE_EncodingHex 1
BE_EncodingBase64 2
Examples :
BE_MessageDigest ( $text ) BE_MessageDigest ( $text ; BE_MessageDigestTypeMD5 ) BE_MessageDigest ( $text ; BE_MessageDigestTypeSHA256 ; BE_EncodingBase64 ) BE_MessageDigest ( $text ; 2 ; 1 ) // BE_MessageDigestAlgorithm_SHA256 and BE_EncodingHex