本文整理了Java中org.jgroups.util.Util.sha()
方法的一些代码示例,展示了Util.sha()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.sha()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:sha
[英]Converts a java.lang.String in to a SHA hashed String
[中]转换java。lang.将字符串插入到SHA散列字符串中
代码示例来源:origin: wildfly/wildfly
/**
* Called during setup to hash the auth_value string in to an MD5/SHA hash
*
* @param token
* the string to hash
* @return the hashed version of the string
*/
private String hash(String token) {
// perform the hashing of the token key
String hashedToken = null;
if (hash_type.equalsIgnoreCase("SHA")) {
hashedToken = Util.sha(token);
} else {
hashedToken = Util.md5(token);
}
if (hashedToken == null) {
// failed to hash - sending the token in clear text
// Note that this may be considered a security vulnerabiltiy if clear text passwords are forbidden.
log.warn("Failed to hash token - sending in clear text");
return token;
}
return hashedToken;
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
/**
* Called during setup to hash the auth_value string in to an MD5/SHA hash
* @param token the string to hash
* @return the hashed version of the string
*/
private String hash(String token){
//perform the hashing of the token key
String hashedToken = null;
if(hash_type.equalsIgnoreCase("SHA")){
hashedToken = Util.sha(token);
}else{
hashedToken = Util.md5(token);
}
if(hashedToken == null){
//failed to encrypt
if(log.isWarnEnabled()){
log.warn("Failed to hash token - sending in clear text");
}
return token;
}
return hashedToken;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Called during setup to hash the auth_value string in to an MD5/SHA hash
*
* @param token
* the string to hash
* @return the hashed version of the string
*/
private String hash(String token) {
// perform the hashing of the token key
String hashedToken = null;
if (hash_type.equalsIgnoreCase("SHA")) {
hashedToken = Util.sha(token);
} else {
hashedToken = Util.md5(token);
}
if (hashedToken == null) {
// failed to hash - sending the token in clear text
// Note that this may be considered a security vulnerabiltiy if clear text passwords are forbidden.
log.warn("Failed to hash token - sending in clear text");
return token;
}
return hashedToken;
}
内容来源于网络,如有侵权,请联系作者删除!