As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public class MD4HashGenerator { static { try { MessageDigest.getInstance("MD4"); } catch (NoSuchAlgorithmException e) { Security.addProvider(new CryptixCrypto()); } } public MD4HashGenerator() { super(); } /** * @param args */ public static void main(String[] args) { System.out.println("Hash: " + new String(Hex.encodeHex(md4(args[0])))); } private static byte[] md4(String input) { try { MessageDigest digester = MessageDigest.getInstance("MD4"); return digester.digest(input.getBytes("UnicodeLittleUnmarked")); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e.getMessage(), e); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } } }