mendix / RestServices

REST service module for Mendix. Supports consuming and publishing REST based services and real-time data synchronization. Supports JSON, form-encoded, multipart and binary data transport.
Apache License 2.0
31 stars 46 forks source link

Drop dependency on Commons Codec by native MD5 digest call #100

Open reinouts opened 6 years ago

reinouts commented 6 years ago

Proposed implementation of Utils.getMD5Hash():

public static String getMD5Hash(String jsonString) throws UnsupportedEncodingException, NoSuchAlgorithmException {
    byte[] bytesOfMessage = jsonString.getBytes(RestServices.UTF8);
    MessageDigest md = MessageDigest.getInstance("MD5");
    return new String(md.digest(bytesOfMessage));
}