Question About RAW & MD5 Hash
Sami, January 22, 2004 - 2:34 pm UTC
1.When we say RAW, is it a Hexadecimal number all the time?
2) My java application expects to return HASH value(which we are going to store it in db) as STRING. So is it okay to store HASH value in VARCHAR2 datatype column?
I use below method for MD5 hash.
SQL> CREATE OR REPLACE FUNCTION MD5_RAW (INPUT_VAL VARCHAR2)
2 RETURN VARCHAR2
3 IS
4 SOMETHING_RAW RAW(100) := UTL_RAW.CAST_TO_RAW(INPUT_VAL);
5 BEGIN
6 RETURN DBMS_OBFUSCATION_TOOLKIT.MD5( INPUT => SOMETHING_RAW );
7 END;
8 /
January 22, 2004 - 7:59 pm UTC
1) no, it is binary data.
it gets converted to hex for the pleasure of us human beings -- we can read hex. binary just makes our terminals go nuts.
2) that'll return a HEX representation -- it is a varchar2 -- not a raw, so it is 100% OK to save in varchar2, yes.
Absolutely outclass
hash, March 18, 2004 - 1:31 pm UTC
Tom, this expalanation is second to none. thanks a lot
A reader, April 22, 2004 - 11:36 pm UTC