oracle - Why is result from STANDARD_HASH('expr', 'MD5') always in uppercase? -
i need md5
hash in oracle, use standard_hash
function, have little misunderstanding.
in oracle: select standard_hash('word', 'md5') dual
result is:
c47d187067c6cf953245f128b5fde62a
alphabetical characters in uppercase.
but in other database, example in mysql, result from: select md5('word')
is:
c47d187067c6cf953245f128b5fde62a
exactly same result (lowercase) example php's md5()
function.
question: why returns oracle's standard_hash('expr', 'md5') alphabetical characters in upper case? wrong here?
there no such thing standardized case (uppercase or lowercase) hexadecimal encoding. according rfc 4648 encoding should in uppercase. there other standards out there use lower case.
hash functions defined output bytes, without specifying hexadecimal encoding. if want compare hexadecimal strings instead of bytes which, in opinion, preferred method compare hashes, need case insensitive compare. comparing bytes should preferred.
personally prefer uppercase (as think easier read (people read top of letters) , because there @ least specific standard it. others use lowercase, , there arguments well.
as why oracle returns uppercase specific function: that's question oracle can answer i'm afraid. "because that's how defined" thing can come with.
Comments
Post a Comment