MessageDigest NoSuchAlgorithmException

前端 未结 3 1478
借酒劲吻你
借酒劲吻你 2021-02-10 15:44

I want to use MessageDigest to get a MD5 hash, but I get an error.

import java.security.MessageDigest;

public class dn {
  public static void main(         


        
3条回答
  •  滥情空心
    2021-02-10 16:28

    You should handle the exception:

    try {
    
       MessageDigest md = MessageDigest.getInstance("MD5");
       //...
    
    } catch(NoSuchAlgorithmException x) {
      // do proper exception handling
    }
    

提交回复
热议问题