How to get the MD5 of a string with less effort?

The answer which uses MySQL is the following.

mysql> SELECT MD5('abc');
+----------------------------------+
| MD5('abc')                       |
+----------------------------------+
| 900150983cd24fb0d6963f7d28e17f72 |
+----------------------------------+

On the other hand, in a PHP script, the following code achieves this.

<?php
    print md5('abc');
?>

Obviously, both examples return the same MD5 value.


Here is the definition of MD5 from Wikipedia.

In cryptography, MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. As an Internet standard (RFC 1321), MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files.

MD5 was designed by Ronald Rivest in 1991 to replace an earlier hash function, MD4. In 1996, a flaw was found with the design; while it was not a clearly fatal weakness, cryptographers began to recommend using other algorithms, such as SHA-1 (recent claims suggest that SHA-1 was broken, however). In 2004, more serious flaws were discovered making further use of the algorithm for security purposes questionable.