package com.bcxin.ins.third.build.dubang;

/**
 * 都邦固定字段库
 * @author zxf
 *
 */
public interface DBProp {

	public static final String PRIVATEKEY = "instony1234";//与都邦约定的私钥（按文档来）
	public static final String KEY = "czVsBSUNe7gQK19n6diLiqgrTm4=";//都邦提供。测试key
//	public static final String KEY = "TKlFg3ZslCEEZBwnHe1B2Hlzxc8=";//生产key
	public static final String VERSION = "1.0";//接口版本1.0
	public static final String USERCODE = "200000018";//userCode;
	public static final String COMCODE = "2000000000";//comCode;
	public static final String SYSTEMCODE = "18";//systemCode;
	public static final String PORT_241 = "241";//接口编码
	public static final String PORT_243 = "243";//接口编码
	public static final String PORT_941 = "941";//接口编码
	public static final String PORT_942 = "942";//接口编码

	/**
	 * <b> 都邦md5加密过滤方法 </b>
	 * @author ZXF
	 * @create 2017/12/21 0021 17:52
	 * @version
	 * @注意事项 </b>
	 */
	public static String gbToUnicodeEncoding(String gbString) {
		char[] utfBytes = gbString.toCharArray();
		String unicodeBytes = "";
		for (int byteIndex = 0; byteIndex < utfBytes.length; byteIndex++) {
			String hexB = Integer.toHexString(utfBytes[byteIndex]);   //转换为16进制整型字符串
			if (hexB.length() <= 2) {
				hexB = "00" + hexB;
			}
			unicodeBytes = unicodeBytes + "\\u" + hexB;
		}
		return unicodeBytes;
	}

}
