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

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

本文整理了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

  1. /**
  2. * Converts a java.lang.String in to a MD5 hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String md5(String source) {
  7. try {
  8. MessageDigest md=MessageDigest.getInstance("MD5");
  9. byte[] bytes=md.digest(source.getBytes());
  10. return getString(bytes);
  11. }
  12. catch(Exception e) {
  13. return null;
  14. }
  15. }

代码示例来源:origin: wildfly/wildfly

  1. /**
  2. * Converts a java.lang.String in to a SHA hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String sha(String source) {
  7. try {
  8. MessageDigest md=MessageDigest.getInstance("SHA");
  9. byte[] bytes=md.digest(source.getBytes());
  10. return getString(bytes);
  11. }
  12. catch(Exception e) {
  13. e.printStackTrace();
  14. return null;
  15. }
  16. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. /**
  2. * Converts a java.lang.String in to a MD5 hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String md5(String source) {
  7. try {
  8. MessageDigest md=MessageDigest.getInstance("MD5");
  9. byte[] bytes=md.digest(source.getBytes());
  10. return getString(bytes);
  11. }
  12. catch(Exception e) {
  13. return null;
  14. }
  15. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. /**
  2. * Converts a java.lang.String in to a MD5 hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String md5(String source) {
  7. try {
  8. MessageDigest md = MessageDigest.getInstance("MD5");
  9. byte[] bytes = md.digest(source.getBytes());
  10. return getString(bytes);
  11. } catch (Exception e) {
  12. return null;
  13. }
  14. }
  15. /**

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. /**
  2. * Converts a java.lang.String in to a SHA hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String sha(String source) {
  7. try {
  8. MessageDigest md = MessageDigest.getInstance("SHA");
  9. byte[] bytes = md.digest(source.getBytes());
  10. return getString(bytes);
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. return null;
  14. }
  15. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. /**
  2. * Converts a java.lang.String in to a SHA hashed String
  3. * @param source the source String
  4. * @return the MD5 hashed version of the string
  5. */
  6. public static String sha(String source) {
  7. try {
  8. MessageDigest md=MessageDigest.getInstance("SHA");
  9. byte[] bytes=md.digest(source.getBytes());
  10. return getString(bytes);
  11. }
  12. catch(Exception e) {
  13. e.printStackTrace();
  14. return null;
  15. }
  16. }

相关文章

Util类方法