MySQL Forums
Forum List  »  Oracle

Re: Troubles with MD5
Posted by: Gerald Drake
Date: May 19, 2009 03:49PM

If you are using Oracle you have to do a little more legwork to return the 32 character standard that most languages use. I use this function in oracle databases when I need to maintain compatibility. But, you need to start like this, not sure how to convert legacy data.

Create or Replace Function MD5(input_string in VARCHAR2) RETURN VARCHAR2
-- Same Funaction Name as mySQL to maintaing SQL compatibility
IS
hex_digest varchar2(32);
digest varchar2(16);
BEGIN
digest := DBMS_OBFUSCATION_TOOLKIT.MD5(INPUT_STRING => input_string);
SELECT Lower(RAWTOHEX(digest)) INTO hex_digest FROM dual;
RETURN hex_digest;
END;

Options: ReplyQuote


Subject
Views
Written By
Posted
6494
August 06, 2008 08:39AM
3186
August 27, 2008 12:28AM
Re: Troubles with MD5
3232
May 19, 2009 03:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.