Skip to content
Related Articles

Related Articles

Improve Article

PostgreSQL – MD5 Function

  • Last Updated : 01 Feb, 2021

The PostgreSQL MD5() function is used to evaluate the MD5 hash of a string and subsequently return the result. The result is generally in hexadecimal form.

Syntax: MD5(string)

Let’s analyze the above syntax:

  • The string argument is the string of which the MD5 hash is calculated.
  • The MD5() function is used to return a string in TEXT data type form.

Example 1:

The following statement shows the use of the MD5() function to return the MD5 hash of the message ‘GeeksForGeeks MD5’:

SELECT MD5('GeeksForGeeks MD5');

Output:



Example 2:

The following statement shows the use of the MD5() function to return the MD5 hash of the message ‘This is going to be converted into hexadecimal form ‘:

SELECT MD5('This is going to be converted into hexadecimal form');

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :