本文整理了Java中org.apache.jackrabbit.util.Text.md5()
方法的一些代码示例,展示了Text.md5()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.md5()
方法的具体详情如下:
包路径:org.apache.jackrabbit.util.Text
类名称:Text
方法名:md5
[英]Calculate an MD5 hash of the string given using 'utf-8' encoding.
[中]使用“utf-8”编码计算给定字符串的MD5哈希。
代码示例来源:origin: org.apache.james/james-server-data-jcr
/**
* Hashes salted password.
*
* @param username
* not null
* @param password
* not null
* @return not null
*/
public static String hashPassword(String username, String password) {
// Combine dynamic and static salt
return Text.md5(Text.md5(username + password) + SALT);
}
代码示例来源:origin: org.apache.james/james-server-jcr
/**
* Hashes salted password.
*
* @param username
* not null
* @param password
* not null
* @return not null
*/
public static String hashPassword(String username, String password) {
// Combine dynamic and static salt
final String hashedSaltedPassword = Text.md5(Text.md5(username + password) + SALT);
return hashedSaltedPassword;
}
代码示例来源:origin: apache/jackrabbit
/**
* Calculate an MD5 hash of the string given using 'utf-8' encoding.
*
* @param data the data to encode
* @return a hex encoded string of the md5 digested input
*/
public static String md5(String data) {
try {
return md5(data, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF8 digest not available???");
}
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr-commons
/**
* Calculate an MD5 hash of the string given using 'utf-8' encoding.
*
* @param data the data to encode
* @return a hex encoded string of the md5 digested input
*/
public static String md5(String data) {
try {
return md5(data, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF8 digest not available???");
}
}
代码示例来源:origin: org.apache.jackrabbit/com.springsource.org.apache.jackrabbit.commons
/**
* Calculate an MD5 hash of the string given using 'utf-8' encoding.
*
* @param data the data to encode
* @return a hex encoded string of the md5 digested input
*/
public static String md5(String data) {
try {
return md5(data, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF8 digest not available???");
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
/**
* Calculate an MD5 hash of the string given using 'utf-8' encoding.
*
* @param data the data to encode
* @return a hex encoded string of the md5 digested input
*/
public static String md5(String data) {
try {
return md5(data, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF8 digest not available???");
}
}
代码示例来源:origin: com.github.igor-suhorukov/dom-transformation
/**
* Calculate an MD5 hash of the string given using 'utf-8' encoding.
*
* @param data the data to encode
* @return a hex encoded string of the md5 digested input
*/
public static String md5(String data) {
try {
return md5(data, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new InternalError("UTF8 digest not available???");
}
}
代码示例来源:origin: apache/jackrabbit
public WorkspaceContentHandler(Workspace workspace, String parentAbsPath, int uuidBehavior) throws RepositoryException {
this.workspace = workspace;
this.parentAbsPath = parentAbsPath;
this.uuidBehavior = uuidBehavior;
try {
String tmpName = Text.md5(parentAbsPath);
this.tmpFile = File.createTempFile("___" + tmpName, ".xml");
this.delegatee = SerializingContentHandler.getSerializer(
new FileOutputStream(tmpFile));
} catch (FileNotFoundException e) {
throw new RepositoryException(e);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (SAXException e) {
throw new RepositoryException(e);
}
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi
public WorkspaceContentHandler(Workspace workspace, String parentAbsPath, int uuidBehavior) throws RepositoryException {
this.workspace = workspace;
this.parentAbsPath = parentAbsPath;
this.uuidBehavior = uuidBehavior;
try {
String tmpName = Text.md5(parentAbsPath);
this.tmpFile = File.createTempFile("___" + tmpName, ".xml");
this.delegatee = SerializingContentHandler.getSerializer(
new FileOutputStream(tmpFile));
} catch (FileNotFoundException e) {
throw new RepositoryException(e);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (SAXException e) {
throw new RepositoryException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!