DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23593>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23593 Add DigestUtils facade around java.security.MessageDigest Summary: Add DigestUtils facade around java.security.MessageDigest Product: Commons Version: 2.0 Final Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: Lang AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Using the java.security.MessageDigest class to generate MD5 and SHA hashes are harder to use than they need to be for creating simple digests. Also, it returns the digest as an array of bytes, where often a hex string is needed. A DigestUtils class that contains the following interface would be helpful: public static String md5Hex(String data) public static String md5Hex(byte[] data) public static byte[] md5(String data) public static byte[] md5(byte[] data) public static String shaHex(String data) public static String shaHex(byte[] data) public static byte[] sha(String data) public static byte[] sha(byte[] data) The checked exceptions thrown by the MessageDigest factory are converted into runtime exceptions. As brought up in the mailing list, this may fall under Commons Codec. IMHO, this isn't really an encoder and decoder, and more of a facade around core Java classes. But either way, it seems it should fall under some Commons project as it seems quite useful outside of my current project. http://www.mail-archive.com/[EMAIL PROTECTED]/msg04418.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
