Here you can find the source of compareMD5(String md5a, String md5b)
public final static boolean compareMD5(String md5a, String md5b)
//package com.java2s; //License from project: Open Source License public class Main { public final static boolean compareMD5(String md5a, String md5b) { if ((!isValidMD5(md5a)) || (!isValidMD5(md5b))) { return false; }/* w w w. j a v a 2s .c om*/ return md5a.equalsIgnoreCase(md5b); } private static boolean isValidMD5(String md5) { if (md5 == null) { return false; } // Check length AND characters return md5.matches("^[0-9A-Fa-f]{32}+$"); } }