@@ -0,0 +1,998 @@
+package helper;%0A%0Apublic class Hash %7B%0A    /**%0A     * @param value    string%0A     * @param hashType MD5 OR SHA1%0A     * @return string hash of txt%0A     */%0A    public static String getHash(String value, String hashType) %7B%0A        String hash = null;%0A        try %7B%0A            java.security.MessageDigest md = java.security.MessageDigest.getInstance(hashType);%0A            byte%5B%5D array = md.digest(value.getBytes());%0A            StringBuilder stringBuffer = new StringBuilder();%0A            for (byte anArray : array) %7B%0A                stringBuffer.append(Integer.toHexString((anArray & 0xFF) %7C 0x100).substring(1, 3));%0A            %7D%0A            hash = stringBuffer.toString();%0A        %7D catch (java.security.NoSuchAlgorithmException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return hash;%0A    %7D%0A%0A    public static String md5(String value) %7B%0A        return Hash.getHash(value, %22MD5%22);%0A    %7D%0A%0A    public static String sha1(String value) %7B%0A        return Hash.getHash(value, %22SHA1%22);%0A    %7D%0A%7D%0A

add hash