Search code examples
stringarraysmd5checksum

Md5-Hash-ByteArray is working in programm but not in external validator, (need to convert it to some kind of String)


I am creating a raw MD5-Bytearray of some file and store it in a DB. Then, when I upload the file I validate the Checksum. So far everything works fine.

Now I am trying to display the Checksum in the standard form like, for example, this:

0709bfccaec24cbb5734b905dda8d616

but all I got were some cryptic things, e.g.

[B@1fd3b78a

How do I best get the String?


Solution

  • So the representation I was looking for is appearantly the Hexadezimal representation of the bytes. I converted and saved it as a String:

    How to convert a byte array to a hex string in Java?