// Path: src/org/dazzle/common/exception/BaseException.java
// public class BaseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 7369919371075409501L;
// 	
// 	private String code = null;
// 
// 	/** 获取异常编码 
// 	 * @author hcqt@qq.com*/
// 	public String getCode() {
// 		if(null != code) {
// 			return code;
// 		}
// 		return code;
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException() {
// 		super();
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException(
// 			final String code, 
// 			final String message, 
// 			final Object... msgArg) {
// 		super(MsgI18n.getMsg(code, message, msgArg));
// 		this.code = code;
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException(
// 			final String code, 
// 			final String message, 
// 			final Throwable cause, 
// 			final Object... msgArg) {
// 		super(MsgI18n.getMsg(code, message, msgArg), cause);
// 		this.code = code;
// 	}
// 
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.dazzle.common.exception.BaseException;
	 *
	 * @param bytes 待转换Byte数组
	 * @return 转换结果
	 * @since 0.2
	 * @author hcqt@qq.com
	 */
	public static final String bytesToHex(byte[] bytes) {
		int length = bytes.length;
		StringBuilder sb = new StringBuilder(2 * length);
		for (int i = 0; i < length; i++) {
			sb.append(HEX_DIGITS[(bytes[i] & 0xf0) >> 4]);
			sb.append(HEX_DIGITS[bytes[i] & 0xf]);
		}
		return sb.toString();
	}

	/**
	 * 获得指定的算法加密器
	 *
	 * @param algorithm 算法
	 * @throws CatGroupException 如果没有参数algorithm指定的加密算法则抛出此异常
	 * @return 加密器
	 * @since 0.2
	 * @author hcqt@qq.com
	 */
	private static final MessageDigest getEncrypt(String algorithm) {
		try {
			return MessageDigest.getInstance(algorithm);
		}
		catch (NoSuchAlgorithmException ex) {
// Path: src/org/dazzle/common/exception/BaseException.java
// public class BaseException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 7369919371075409501L;
// 	
// 	private String code = null;
// 
// 	/** 获取异常编码 
// 	 * @author hcqt@qq.com*/
// 	public String getCode() {
// 		if(null != code) {
// 			return code;
// 		}
// 		return code;
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException() {
// 		super();
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException(
// 			final String code, 
// 			final String message, 
// 			final Object... msgArg) {
// 		super(MsgI18n.getMsg(code, message, msgArg));
// 		this.code = code;
// 	}
// 
// 	/** @author hcqt@qq.com */
// 	public BaseException(
// 			final String code, 
// 			final String message, 
// 			final Throwable cause, 
// 			final Object... msgArg) {
// 		super(MsgI18n.getMsg(code, message, msgArg), cause);
// 		this.code = code;
// 	}
// 
// }


// Path: src/org/dazzle/utils/EncryptUtils.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.dazzle.common.exception.BaseException;

	 *
	 * @param bytes 待转换Byte数组
	 * @return 转换结果
	 * @since 0.2
	 * @author hcqt@qq.com
	 */
	public static final String bytesToHex(byte[] bytes) {
		int length = bytes.length;
		StringBuilder sb = new StringBuilder(2 * length);
		for (int i = 0; i < length; i++) {
			sb.append(HEX_DIGITS[(bytes[i] & 0xf0) >> 4]);
			sb.append(HEX_DIGITS[bytes[i] & 0xf]);
		}
		return sb.toString();
	}

	/**
	 * 获得指定的算法加密器
	 *
	 * @param algorithm 算法
	 * @throws CatGroupException 如果没有参数algorithm指定的加密算法则抛出此异常
	 * @return 加密器
	 * @since 0.2
	 * @author hcqt@qq.com
	 */
	private static final MessageDigest getEncrypt(String algorithm) {
		try {
			return MessageDigest.getInstance(algorithm);
		}
		catch (NoSuchAlgorithmException ex) {
			throw new BaseException("encrypt_file_j3fvU", "创建{0}算法加密器失败，详情——{1}", ex, algorithm, EU.out(ex));