MySQL does that for you

PHP Code:
SELECT md5('test'