New file |
0,0 → 1,22 |
package pt.estgp.estgweb.services.utils; |
|
import jomm.utils.BytesUtils; |
|
/** |
* Created by jorgemachado on 10/10/16. |
*/ |
public class UrlHashValidatorService { |
|
private static final String PREFIX_TRASH = "#=%$%&(dsfde"; |
private static final String SUFFIX_TRASH = "vF64%dKZd_9d"; |
|
public static String getHashString(String data) |
{ |
return BytesUtils.getMD5(PREFIX_TRASH + data + SUFFIX_TRASH); |
} |
|
public static boolean checkHashString(String data, String hash) |
{ |
return hash.equals(getHashString(data)); |
} |
} |