org.jgroups.util.Util.getString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中org.jgroups.util.Util.getString()方法的一些代码示例,展示了Util.getString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getString()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getString

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;
  }
}

相关文章

Util类方法