转半角的函数(DBC case)
全角空格为12288，半角空格为32
其他字符半角(33-126)与全角(65281-65374)的对应关系是：均相差65248
@param input 任意字符串 全角字符串
@return 半角字符串
161160
public static String toHalfWidth(String input) {

		char[] c = input.toCharArray();
		for (int i = 0; i< c.length; i++) {
			if (c[i] == 12288) {
				c[i] = (char) 32;
				continue;
			}
			if (c[i]> 65280&& c[i]< 65375)
				c[i] = (char) (c[i] - 65248);
		}
		return new String(c);
	}
1069962
public static boolean scan(final char[] input)
	{

		int surLow = 0xD800;
		int surHgh = 0xDFFF;

		int end = input.length;
		for (int i = 0; i < end; i++) {
			if ((int) input[i] >= surLow && input[i] <= surHgh) {
				return true;
			}
		}

		return false;
	}
481280
public static boolean isLong(String input) {
        try {
            Long.parseLong(input);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
778109
function(input) {

			if (!isFullId && baseCharSet.set == DEFAULT_BASESET)
			{
				input = Utils.getObjectIdTime(input);
			}

			var bitStream = BitStream(String(input), baseCharSet);

			var result = '';
			while (!bitStream.isEOF())
			{
				var value = bitStream.getBits(encodingCharSet.bits);
				var nextChar = encodingCharSet.encode(value);
				if (isInverse)
				{
					result = nextChar + result;
				}
				else
				{
					result += nextChar;
				}
			}

			return result;
		}
853994
public static String toSBC(String input, Set<Character> notConvertSet) {
		char c[] = input.toCharArray();
		for (int i = 0; i < c.length; i++) {
			if (null != notConvertSet && notConvertSet.contains(c[i])) {
				// 跳过不替换的字符
				continue;
			}

			if (c[i] == ' ') {
				c[i] = '\u3000';
			} else if (c[i] < '\177') {
				c[i] = (char) (c[i] + 65248);

			}
		}
		return new String(c);
	}
218318
public static long crc32AsLong(@NotNull byte[] input) {
		CRC32 crc32 = new CRC32();
		crc32.update(input);
		return crc32.getValue();
	}
935109
public static int murmur32AsInt(@NotNull String input) {
		return Hashing.murmur3_32(MURMUR_SEED).hashString(input, Charsets.UTF_8).asInt();
	}
1158092
private static final int base64ValueOf (final char c) {
        if ('A' <= c && c <= 'Z') return c - 'A';
        if ('a' <= c && c <= 'z') return c - 'a' + 26;
        if ('0' <= c && c <= '9') return c - '0' + 52;
        if (c == '+') return 62;
        if (c == '/') return 63;
        throw new NumberFormatException();
    }
136250
public static String rset(String input, int width)
   {
      String result; // result to return
      StringBuilder pad = new StringBuilder();
      if (input == null)
      {
         for (int i = 0; i < width - 1; i++)
         {
            pad.append(' '); // put blanks into buffer
         }
         result = " " + pad; // one short to use + overload
      }
      else
      {
         if (input.length() >= width)
         {
            result = input.substring(0, width); // when input is too long, truncate
         }
         else
         {
            int padLength = width - input.length(); // number of blanks to add
            for (int i = 0; i < padLength; i++)
            {
               pad.append(' '); // actually put blanks into buffer
            }
            result = pad + input; // concatenate
         }
      }
      return result;
   }
1264980
public static String convertCharsFromXml(String input) {
		StringBuffer result = new StringBuffer();
		for(int i=0; i<input.length();) {
			if(input.charAt(i)=='&') {
				if(input.substring(i, i+3).equals("&lt;")) {
					result.append('<');
					i += 4;
				} else if(input.substring(i, i+3).equals("&gt;")) {
					result.append('>');
					i += 4;
				} else if(input.substring(i, i+4).equals("&amp;")) {
					result.append('&');
					i += 5;
				} else if(input.substring(i, i+5).equals("&quot;")) {
					result.append('"');
					i += 6;
				} else if(input.substring(i, i+5).equals("&apos;")) {
					result.append('\'');
					i += 6;
				} else {
					result.append(input.charAt(i));
					i++;
				}
			} else {
				result.append(input.charAt(i));
				i++;
			}
		}
		return result.toString();
	}
910498
public static String unAccent(String input) {
        if (MAP_NORM == null || MAP_NORM.size() == 0) {
            MAP_NORM = new HashMap<Character, Character>();
            MAP_NORM.put('À', 'A');
            MAP_NORM.put('Á', 'A');
            MAP_NORM.put('Â', 'A');
            MAP_NORM.put('Ã', 'A');
            MAP_NORM.put('Ä', 'A');
            MAP_NORM.put('È', 'E');
            MAP_NORM.put('É', 'E');
            MAP_NORM.put('Ê', 'E');
            MAP_NORM.put('Ë', 'E');
            MAP_NORM.put('Í', 'I');
            MAP_NORM.put('Ì', 'I');
            MAP_NORM.put('Î', 'I');
            MAP_NORM.put('Ï', 'I');
            MAP_NORM.put('Ù', 'U');
            MAP_NORM.put('Ú', 'U');
            MAP_NORM.put('Û', 'U');
            MAP_NORM.put('Ü', 'U');
            MAP_NORM.put('Ò', 'O');
            MAP_NORM.put('Ó', 'O');
            MAP_NORM.put('Ô', 'O');
            MAP_NORM.put('Õ', 'O');
            MAP_NORM.put('Ö', 'O');
            MAP_NORM.put('Ñ', 'N');
            MAP_NORM.put('Ç', 'C');
            MAP_NORM.put('ª', 'A');
            MAP_NORM.put('º', 'O');
            MAP_NORM.put('§', 'S');
            MAP_NORM.put('³', '3');
            MAP_NORM.put('²', '2');
            MAP_NORM.put('¹', '1');
            MAP_NORM.put('à', 'a');
            MAP_NORM.put('á', 'a');
            MAP_NORM.put('â', 'a');
            MAP_NORM.put('ã', 'a');
            MAP_NORM.put('ä', 'a');
            MAP_NORM.put('è', 'e');
            MAP_NORM.put('é', 'e');
            MAP_NORM.put('ê', 'e');
            MAP_NORM.put('ë', 'e');
            MAP_NORM.put('í', 'i');
            MAP_NORM.put('ì', 'i');
            MAP_NORM.put('î', 'i');
            MAP_NORM.put('ï', 'i');
            MAP_NORM.put('ù', 'u');
            MAP_NORM.put('ú', 'u');
            MAP_NORM.put('û', 'u');
            MAP_NORM.put('ü', 'u');
            MAP_NORM.put('ò', 'o');
            MAP_NORM.put('ó', 'o');
            MAP_NORM.put('ô', 'o');
            MAP_NORM.put('õ', 'o');
            MAP_NORM.put('ö', 'o');
            MAP_NORM.put('ñ', 'n');
            MAP_NORM.put('ç', 'c');
        }

        if (input == null) {
            return "";
        }

        StringBuilder sb = new StringBuilder(input);

        for (int i = 0; i < input.length(); i++) {
            Character c = MAP_NORM.get(sb.charAt(i));
            if (c != null) {
                sb.setCharAt(i, c.charValue());
            }
        }

        return sb.toString();

    }
1135201
public String normalizeCAP(String input,boolean b) {
		char[] c = input.toCharArray();
		normalise(c);

		for (int i = 0; i< c.length; i++) {
			if(b){
				if(c[i] > 96 && c[i] < 123){
					c[i] -= 32;

				}
			}
			else{
				if(c[i] > 64 && c[i] < 91){
					c[i] += 32;
				}

			}
		}

		return new String(c);
	}
1162075
public static byte[] decodeChecked(String input) {
      byte tmp[] = decode(input);
      if (tmp == null || tmp.length < 4) {
         return null;
      }
      byte[] bytes = copyOfRange(tmp, 0, tmp.length - 4);
      byte[] checksum = copyOfRange(tmp, tmp.length - 4, tmp.length);

      tmp = HashUtils.doubleSha256(bytes);
      byte[] hash = copyOfRange(tmp, 0, 4);
      if (!Arrays.equals(checksum, hash)) {
         return null;
      }

      return bytes;
   }
1351011
static String toLowerCamelCaseWithNumericSuffixes(String input) {
    // Determine where the numeric suffixes begin
    int suffixStart = input.length();
    while (suffixStart > 0) {
      char ch = '\0';
      int numberStart = suffixStart;
      while (numberStart > 0) {
        ch = input.charAt(numberStart - 1);
        if (Character.isDigit(ch)) {
          numberStart--;
        } else {
          break;
        }
      }
      if ((numberStart > 0) && (numberStart < suffixStart) && (ch == '_')) {
        suffixStart = numberStart - 1;
      } else {
        break;
      }
    }

    if (suffixStart == input.length()) {
      return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, input);
    } else {
      return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL,
          input.substring(0, suffixStart)) + input.substring(suffixStart);
    }
  }
221639
public static List<Token> tokenize(final String input) {
        List<Token> result = new ArrayList<Token>();
        if (input == null) {
            return result;
        }

        final int WHITESPACE = 0;
        final int WORD = 1;
        final int STRINGDQ = 2;
        final int STRINGSQ = 3;
        final int COMMENT = 4;

        int state = WHITESPACE;
        char ch; // character in hand
        int tokenIndex = -1;
        StringBuilder token = new StringBuilder("");

        for (int i = 0; i < input.length(); i++) {
            ch = input.charAt(i);
            switch (state) {
                case WHITESPACE:
                    if (Character.isWhitespace(ch)) {
                        // keep state
                    } else if (Character.isLetterOrDigit(ch) || ch == '_') {
                        state = WORD;
                        tokenIndex = i;
                        token.append(ch);
                    } else if (ch == '"') {
                        state = STRINGDQ;
                        tokenIndex = i;
                    } else if (ch == '\'') {
                        state = STRINGSQ;
                        tokenIndex = i;
                    } else if (ch == '#') {
                        state = COMMENT;
                    } else {
                        state = WORD;
                        tokenIndex = i;
                        token.append(ch);
                    }
                    break;

                case WORD:
                    if (Character.isWhitespace(ch)) {
                        // submit token
                        result.add(new Token(tokenIndex, token.toString()));
                        token.setLength(0);
                        state = WHITESPACE;
                    } else if (Character.isLetterOrDigit(ch) || ch == '_') {
                        token.append(ch); // and keep state
                    } else if (ch == '"') {
                        if (i < input.length()-1 && input.charAt(i+1) == '"' ) {
                            // Yes, it's somewhat wrong in terms of statemachine, but it's the
                            // simplest and crearest way.
                            token.append('"');
                            i++;
                            // and keep state.
                        } else {
                            state = STRINGDQ; // but don't append; a"b"c is the same as abc.
                        }
                    } else if (ch == '\'') {
                        if (i < input.length()-1 && input.charAt(i+1) == '\'' ) {
                            // Yes, it's somewhat wrong in terms of statemachine, but it's the
                            // simplest and crearest way.
                            token.append('\'');
                            i++;
                            // and keep state.
                        } else {
                            state = STRINGSQ; // but don't append; a"b"c is the same as abc.
                        }
                    } else if (ch == '#') {
                        // submit token
                        result.add(new Token(tokenIndex, token.toString()));
                        token.setLength(0);
                        state = COMMENT;
                    } else {
                        // for now we do allow special chars in words
                        token.append(ch);
                    }
                    break;

                case STRINGDQ:
                    if (ch == '"') {
                        if (i < input.length() - 1 && input.charAt(i+1) == '"') {
                            token.append('"');
                            i++;
                            // and keep state
                        } else {
                            state = WORD;
                        }
                    } else {
                        token.append(ch);
                    }
                    break;

                case STRINGSQ:
                    if (ch == '\'') {
                        if (i < input.length() - 1 && input.charAt(i+1) == '\'') {
                            token.append('\'');
                            i++;
                            // and keep state
                        } else {
                            state = WORD;
                        }
                    } else {
                        token.append(ch);
                    }
                    break;

                case COMMENT:
                    // eat ch
                    break;

                default:
                    assert false : "Unknown state in Shell.tokenize() state machine";
                    break;
            }
        }

        if (state == WORD || state == STRINGDQ || state == STRINGSQ) {
            result.add(new Token(tokenIndex, token.toString()));
        }

        return result;
    }
452977
public static String[] asStringArray(List<String> input) {
		String[] result = new String[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
160702
function( input ) {

		if ( input == null ) {

			input = this.result;

		}

		for (var i = 0; i < input.length; i++) {

			if ( isNaN( parseInt( input.charAt( i ) ) ) ) continue;

			else {

			this.temp = this.persian_number[ parseInt( input.charAt( i ) ) ];

			this.result = this.result.replace( input.charAt( i ), this.temp );

			}

		}

		return this;

	}