src/com/vehiclerental/utils/CryptoUtils.java
/**
     * Hash a given plain text value using SHA256 (encoded in hexadecimal)
     *
     * @param clearMessage plain text message
     * @return hashed string
     * @throws NoSuchAlgorithmException if the encryption system fails
     * @throws UnsupportedEncodingException if the encoding system fails
     */
Hash a given plain text value using SHA256 (encoded in hexadecimal)
@param clearMessage plain text message
@return hashed string
@throws NoSuchAlgorithmException if the encryption system fails
@throws UnsupportedEncodingException if the encoding system fails
Hash a given plain text value using SHA256 ( encoded in hexadecimal ) @param clearMessage plain text message @return hashed string @throws NoSuchAlgorithmException if the encryption system fails @throws UnsupportedEncodingException if the encoding system fails
public static String Sha256Hash(String clearMessage) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = MessageDigest.getInstance("SHA-256");
        byte[] hashedBytes = md.digest(clearMessage.getBytes("UTF-8"));
        return byteArrayToHexString(hashedBytes);
    }
public static String Sha256Hash ( String clearMessage ) throws NoSuchAlgorithmException , UnsupportedEncodingException { MessageDigest md = MessageDigest . getInstance ( "SHA-256" ) ; byte [ ] hashedBytes = md . digest ( clearMessage . getBytes ( "UTF-8" ) ) ; return byteArrayToHexString ( hashedBytes ) ; }
Hash a given plain text value using SHA256 (encoded in hexadecimal)
 @param clearMessage plain text message
 @return hashed string
 @throws NoSuchAlgorithmException if the encryption system fails
 @throws UnsupportedEncodingException if the encoding system fails
Hash a given plain text value using SHA256 ( encoded in hexadecimal ) @param clearMessage plain text message @return hashed string @throws NoSuchAlgorithmException if the encryption system fails @throws UnsupportedEncodingException if the encoding system fails