本文整理了Java中org.jgroups.util.Util.getString()
方法的一些代码示例,展示了Util.getString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getString()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getString
[英]Used to convert a byte array in to a java.lang.String object
[中]用于将字节数组转换为java。字符串对象
代码示例来源:origin: wildfly/wildfly
/**
* Converts a java.lang.String in to a MD5 hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String md5(String source) {
try {
MessageDigest md=MessageDigest.getInstance("MD5");
byte[] bytes=md.digest(source.getBytes());
return getString(bytes);
}
catch(Exception e) {
return null;
}
}
代码示例来源:origin: wildfly/wildfly
/**
* Converts a java.lang.String in to a SHA hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String sha(String source) {
try {
MessageDigest md=MessageDigest.getInstance("SHA");
byte[] bytes=md.digest(source.getBytes());
return getString(bytes);
}
catch(Exception e) {
e.printStackTrace();
return null;
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Converts a java.lang.String in to a MD5 hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String md5(String source) {
try {
MessageDigest md=MessageDigest.getInstance("MD5");
byte[] bytes=md.digest(source.getBytes());
return getString(bytes);
}
catch(Exception e) {
return null;
}
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
/**
* Converts a java.lang.String in to a MD5 hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String md5(String source) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] bytes = md.digest(source.getBytes());
return getString(bytes);
} catch (Exception e) {
return null;
}
}
/**
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
/**
* Converts a java.lang.String in to a SHA hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String sha(String source) {
try {
MessageDigest md = MessageDigest.getInstance("SHA");
byte[] bytes = md.digest(source.getBytes());
return getString(bytes);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Converts a java.lang.String in to a SHA hashed String
* @param source the source String
* @return the MD5 hashed version of the string
*/
public static String sha(String source) {
try {
MessageDigest md=MessageDigest.getInstance("SHA");
byte[] bytes=md.digest(source.getBytes());
return getString(bytes);
}
catch(Exception e) {
e.printStackTrace();
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!