java SHA-256加密

String str = "test";
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
byte[] hash = messageDigest.digest(str.getBytes("UTF-8"));
String encodeStr = Hex.encodeHexString(hash);

你可能感兴趣的:(Java,java)