This topic describes how to use the string function MD5 in Realtime Compute.

Syntax

VARCHAR MD5(VARCHAR str)

Parameter

  • str
  • VARCHAR

Description

Returns the MD5 value of a string. If the input parameter is an empty string ("), an empty string is returned.

Example

  • Test data
    str1 (VARCHAR) str2 (VARCHAR)
    k1=v1;k2=v2 null
  • Test statements
    SELECT
       MD5(str1) as var1,
       MD5(str2) as var2
    FROM T1;         
  • Test results
    var1 (VARCHAR) var2 (VARCHAR)
    19c17f42b4d6a90f7f9ffc2ea9bdd775 null