Java MessageDigest类的使用

MessageDigest简介

创建MessageDigest实例

 public static MessageDigest getInstance(String algorithm)
 public static MessageDigest getInstance(String algorithm, String provider)

更新报文摘要对象

  public void update(byte input)
  public void update(byte[] input)
  public void update(byte[] input, int offset, int len) 

计算摘要

  public byte[] digest()
  public byte[] digest(byte[] input)
  public int digest(byte[] buf, int offset, int len)

Attention