SHA加密

 public static String encryptSHA(String data) throws Exception {
  MessageDigest sha = MessageDigest.getInstance("SHA-256");
  byte[] bs = sha.digest(data.getBytes());
  String reStr = new HexBinaryAdapter().marshal(bs);
  return reStr;
 }

你可能感兴趣的:(sha)