Hi how I can read md5 hash from textfile and compare it with other md5 hash. I know that MessageDigest.isEqual() is right method for me but how to get the hahs from file without changing it. I can read it to String but if I use getBytes() method it obviously changes it.

ps. This problem is close to problem I had earlier(Same project), so would it be better to just use that thread or start new?

I think you have hashes in hex form in file... The simple solution for this is to convert the message digest hash to hex form before comparing it with file hash. It will solve your problem.

2nd method would be reading the bytes and then converting into 8bit scheme. It is possible search hex to ascii encoding in java, u will get a lot examples.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.