03-17-2006 07:14 AM
03-17-2006 09:52 AM
03-17-2006 10:25 AM
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);
        }
    }
}
03-24-2006 03:51 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.