PostgreSQL MD5() Function
The PostgreSQLMD5() function calculates theMD5 hash of a string and returns the result in hexadecimal.
Syntax
The following illustrates the syntax of theMD5() function:
MD5(string)Arguments
TheMD5() function accepts one argument.
1)string
Thestring argument is the string of which the MD5 hash is calculated.
Return value
TheMD5() function returns a string inTEXT data type.
Examples
The following example shows how to use theMD5() function to return the MD5 hash of the message'PostgreSQL MD5':
SELECT MD5('PostgreSQL MD5');The result is:
md5---------------------------------- f78fdb18bf39b23d42313edfaf7e0a44(1 row)In this tutorial, you have learned how to use the PostgreSQLMD5() function to calculate the MD5 hash of a string.
Last updated on
Was this page helpful?
Thank you for your feedback!