/**
* 打包字符串
* 类似php中pack在java中的实现
*
* @param str
* @return
*/
public static byte[] pack(String str) {
int nibbleshift = 4;
int position = 0;
int len = str.length() / 2 + str.length() % 2;
byte[] output = new byte[len];
for (char v : str.toCharArray()) {
byte n = (byte) v;
if (n >= '0' && n = 'A' && n = 'a' && n