package com.kmall.manager.manager.express.sf;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;


public class SecurityUtil {
	private static final Logger LOGGER = LoggerFactory.getLogger(SecurityUtil.class);

	private static MessageDigest messagedigest;

	static {
		try {
			messagedigest = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			if (LOGGER.isErrorEnabled()) {
				LOGGER.error("Fail to create MD5 instance: ", e);
			}
		}
	}
	
	public static byte[] md5Digest(byte[] data){
		return messagedigest.digest(data);
	}
	
	
	
	
}
