6 ms·
Another example of "Wtf were they thinking when they wrote this?" in the Java stdlib is MessageDigest. To build a digester object, you must pass it a string lit
by dead10ck 12y ago
Another example of "Wtf were they thinking when they wrote this?" in the Java stdlib is MessageDigest. To build a digester object, you must pass it a string literal to tell it which algorithm to use, and catch a NoSuchAlgorithm exception. Instead of, you know, just using an enum for all supported algorithms.
- crypto5 12y agoI think standard Java library API doesn't know what algorithms are supported on particular platform, additionally you can implement your own messagedigest.
- AnimalMuppet 12y agoRight - if I understand correctly, it can depend on what crypto packages are installed on your target.
- dead10ck 12y agoThey list the algorithms explicitly here: https://docs.oracle.com/javase/7/docs/api/java/security/MessageDigest.html https://docs.oracle.com/javase/7/docs/api/java/security/Mess... And here: https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest https://docs.oracle.com/javase/7/docs/technotes/guides/secur...