package org.zanata.util;

import java.security.MessageDigest;

import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;

public class HashUtil
{

   public static String generateHash(String key)
   {
      try
      {
         MessageDigest md5 = MessageDigest.getInstance("MD5");
         md5.reset();
         return new String(Hex.encodeHex(md5.digest(key.getBytes("UTF-8"))));
      }
      catch (Exception exc)
      {
         throw new RuntimeException(exc);
      }
   }
   
   public static String md5Hex(String message)
   {
      return DigestUtils.md5Hex(message);
   }
}

@@ -178,16 +178,95 @@
 Util%0A%7B%0A%0A
+   // This class is used in import.sql to provide the MD5 function in H2 tests%0A
    publi

Add comment