package com.worldsmostinterestinginfographic.util;

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public enum LoggingUtils {
  INSTANCE;

  public static String anonymize(String statement) {
    byte[] bytesOfMessage = statement.getBytes(StandardCharsets.UTF_8);

    MessageDigest md = null;

    try {
      md = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
    }

    byte[] thedigest = md.digest(bytesOfMessage);

    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < thedigest.length; i++) {
      sb.append(Integer.toString((thedigest[i] & 0xff) + 0x100, 16).substring(1));
    }

    return "[" + sb.toString() + "]";
  }
}

@@ -211,16 +211,181 @@
 TANCE;%0A%0A
+  /**%0A   * Anonymize input data.%0A   *%0A   * @param statement The statement to anonymize%0A   * @return An anonymized, but reproducible, version of the input data%0A   */%0A
   public
@@ -425,24 +425,25 @@
 tatement) %7B%0A
+%0A
     byte%5B%5D b
@@ -522,17 +522,28 @@
 Digest m
-d
+essageDigest
  = null;
@@ -543,17 +543,16 @@
 = null;%0A
-%0A
     try 
@@ -560,17 +560,28 @@
 %0A      m
-d
+essageDigest
  = Messa
@@ -710,17 +710,28 @@
 gest = m
-d
+essageDigest
 .digest(
@@ -766,17 +766,27 @@
 Buffer s
-b
+tringBuffer
  = new S
@@ -856,17 +856,27 @@
 %0A      s
-b
+tringBuffer
 .append(
@@ -967,17 +967,27 @@
  %22%5B%22 + s
-b
+tringBuffer
 .toStrin

Add JavaDocs