Get MD5 String from Message Digest

前端 未结 11 1240
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 20:46

I understand how it works but if I want to print out the MD5 as String how would I do that?

public static void getMD5(String fileName) throws Exception{
            


        
11条回答
  •  佛祖请我去吃肉
    2020-12-23 21:05

    You can also use Apache Commons Codec library. This library includes methods public static String md5Hex(InputStream data) and public static String md5Hex(byte[] data) in the DigestUtils class. No need to invent this yourself ;)

提交回复
热议问题