public static boolean verifiesHash(String content, String expectedHashValue) { if (content == null || "".equals(content) || expectedHashValue == null || "".equals(expectedHashValue)) return false; String hashValue; content = content.replace(expectedHashValue, ""); hashValue = FileHashingUtils.md5Hex(content); return expectedHashValue.equals(hashValue); }
public static String setFileHashValue(String content) { return setFileHashValue(content, md5Hex(content)); }