我想在ssha中加密密码。存在一种方法吗?我找到了,但是在sha。
private String encrypt(final String plaintext) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e.getMessage());
}
try {
md.update(plaintext.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage());
}
byte raw[] = md.digest();
String hash = (new BASE64Encoder()).encode(raw);
return hash;
}
Run Code Online (Sandbox Code Playgroud) 我必须问您是否真的要删除选定的项目,我想使用引导箱。...这不起作用!
<s:a onclick="return bootbox.confirm('Are you sure?')" action="deleteElement">
Run Code Online (Sandbox Code Playgroud)