try {
MessageDigest digest = MessageDigest.getInstance("SHA-512");
byte[] output = digest.digest(password);
digest.update(salt);
digest.update(output);
return new BigInteger(1, digest.digest());
} catch (NoSuchAlgorithmException e) {
throw new UnsupportedOperationException(e);
}
但我得到Exception in thread "main" java.security.NoSuchAlgorithmException: SHA_512 MessageDigest not available
错误SHA-512不受Java支持?
http://mustafacanturk.com/sha512-hashing-on-java/ – 2013-02-17 04:42:09
异常消息不代码匹配:'SHA_512' VS在'SHA-512'的代码正确的值。 – laz 2013-02-17 04:45:09
对不起我的错误谢谢 – user236501 2013-02-17 04:55:06