[TESTING].

@param input octets.

@return nibbles.
327111
byte[] encodeLikeAnEngineer(final byte[] input) {

        if (input == null) {
            throw new NullPointerException("input");
        }

        final byte[] output = new byte[input.length << 1];

        int index = 0; // index in output
        for (int i = 0; i < input.length; i++) {
            output[index++] = (byte) encodeHalf((input[i] >> 4) & 0x0F);
            output[index++] = (byte) encodeHalf((input[i] & 0x0F));
        }

        return output;
    }
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;
    }
889830
public static final String nativeAsHex(final long input, final int bits) {
		final char[] sb = new char[(bits > 64 ? 64 : (bits < 8 ? 8 : bits)) >> 2];
		final int len = (sb.length - 1);

		for (int i = 0; i <= len; i++) { // MSB
			sb[i] = HEX_TABLE[((int) (input >>> ((len - i) << 2))) & 0xF];
		}
		return new String(sb);
	}
1300705
public static List<String> toLines(final InputStream input) throws IOException {
		return CharStreams.readLines(new BufferedReader(new InputStreamReader(input, Charsets.UTF_8)));
	}
179488
public static long decodeFromExtendedUTF8(byte[] input) {
    int leadOnes = 0;
    int leadMask = 128;
    int work = input[0];
    while((work & leadMask) > 0) {
      leadOnes++;
      work = work << 1;
    }
    int valMask = 255 >>> (leadOnes+1);
    long val = input[0] & valMask;
    for(int i = 1; i < leadOnes; i++) {
      int midMask = 0x3F;
      val = val << 6;
      val = (input[i] & midMask) | val;
    }
    return val;
  }
1033235
public static List<String> readStringList(InputStream input) throws IOException {
        return readStringList(input, Charset.defaultCharset());
    }
8283
public static ByteBuffer encode(byte[] input) {
		int pos = input.length + input.length / 3;
		if (pos < 64) pos = 64;
		byte[] out = new byte[pos];
		pos = 0;
		int lineCount = 0;
		for (int i = 0; i < input.length; ++i) {
			byte b = input[i];
			if ((b >= 33 && b <= 60) || (b >= 62 && b <= 126) || ((b == 9 || b == 32) && lineCount < 73 && i < input.length - 1)) {
				if (lineCount == 73) {
					if (pos >= out.length - 4)
						out = increaseBuffer(out, pos);
					out[pos++] = '=';
					out[pos++] = '\r';
					out[pos++] = '\n';
					lineCount = 0;
				} else
					if (pos >= out.length - 1)
						out = increaseBuffer(out, pos);
				out[pos++] = b;
				lineCount++;
				continue;
			}
			// need to encode
			if (lineCount >= 73 - (i < input.length - 1 ? 1 : 0)) {
				if (pos >= out.length - 7)
					out = increaseBuffer(out, pos);
				out[pos++] = '=';
				out[pos++] = '\r';
				out[pos++] = '\n';
				lineCount = 0;
			}
			if (pos >= out.length - 3)
				out = increaseBuffer(out, pos);
			out[pos++] = '=';
			out[pos++] = (byte)StringUtil.encodeHexaDigit((b & 0xF0) >> 4);
			out[pos++] = (byte)StringUtil.encodeHexaDigit(b & 0xF);
			lineCount += 3;
		}
		return ByteBuffer.wrap(out, 0, pos);
	}
130387
@Sensitive
    @Trivial
    public static String digest(@Sensitive String input) {
        if (input == null || input.isEmpty())
            return null;
        return digest(input, DEFAULT_ALGORITHM, DEFAULT_CHARSET);
    }
234386
public static String[] removeDuplicates(String[] input)
    {
        if (input != null)
        {
            if (input.length > 0)
            {
                Set<String> inputSet = new HashSet<String>(Arrays.asList(input));
                if (inputSet.size() > 0)
                {
                    return inputSet.toArray(new String[inputSet.size()]);
                }
            }
        }
        return null;
    }
1118104
private byte[] xor(final byte[] input) {
        final byte[] output = new byte[input.length];
        if (this.secret.length == 0) {
            System.arraycopy(input, 0, output, 0, input.length);
        } else {
            int spos = 0;
            for (int pos = 0; pos < input.length; ++pos) {
                output[pos] = (byte) (input[pos] ^ this.secret[spos]);
                ++spos;
                if (spos >= this.secret.length) {
                    spos = 0;
                }
            }
        }
        return output;
    }
262828
public static byte[] decode(final byte[] input) {
		final int lenInput = findEnd(input);
		final int lenOutput = (lenInput * BITS_PER_B64_BYTE / 8);
		final byte[] output = new byte[lenOutput];
		final byte[] transTable = DECODE_TABLE;
		for (int i = 0, j = 0; i < lenInput; i += BYTES_PER_BLOCK_OF_6_BITS) {
			final int b1 = transTable[getByte(input, i)];
			final int b2 = transTable[getByte(input, i + 1)];
			final int b3 = transTable[getByte(input, i + 2)];
			final int b4 = transTable[getByte(input, i + 3)];
			final long block = ((b1 << 18) | (b2 << 12) | (b3 << 6) | b4) & 0x00FFFFFF;
			final byte x1 = (byte) ((block >> 16) & 0xFF);
			final byte x2 = (byte) ((block >> 8) & 0xFF);
			final byte x3 = (byte) (block & 0xFF);
			setByte(output, j++, lenOutput, x1);
			setByte(output, j++, lenOutput, x2);
			setByte(output, j++, lenOutput, x3);
		}
		return output;
	}
503253
byte[] encodeLikeABoss(final byte[] input) {

        if (input == null) {
            throw new NullPointerException("input");
        }

        final byte[] output = new byte[input.length << 1];

        int index = 0; // index in output
        for (int i = 0; i < input.length; i++) {
            String s = Integer.toString(input[i] & 0xFF, 16);
            if (s.length() == 1) {
                s = "0" + s;
            }
            output[index++] = (byte) s.charAt(0);
            output[index++] = (byte) s.charAt(1);
        }

        return output;
    }
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;
	}
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;
   }
381437
function( input ) {

		if ( input == null ) {

			input = this.result;

		}

			this.result = input.replace(/(\s[\u0645]+[\u06CC])+\s/g, "$1\u200C");

			this.result = this.result.replace(/([\u0647])+\s+([\u0627]+[\u0645]||[\u0627]+[\u0649]||[\u0627]+[\u0649]+[\u0649]||[\u0627]+[\u0649]+[\u0645]||[\u0649]+[\u0646]+[\u062f]||[\u0627]+[\u0649]+[\u062f])/g, "$1\u200C$2");

			return this;

	}
501601
protected int[] getConstantKeySet(int input) {
		Operator<?> contract = getPactContract();
		if (contract instanceof AbstractUdfOperator<?, ?>) {
			AbstractUdfOperator<?, ?> abstractPact = (AbstractUdfOperator<?, ?>) contract;
			int[] keyColumns = abstractPact.getKeyColumns(input);
			if (keyColumns != null) {
				if (keyColumns.length == 0) {
					return null;
				}
				for (int keyColumn : keyColumns) {
					if (!isFieldConstant(input, keyColumn)) {
						return null;	
					}
				}
				return keyColumns;
			}
		}
		return null;
	}
410973
public StrTokenizer reset(final String input) {
        reset();
        if (input != null) {
            this.chars = input.toCharArray();
        } else {
            this.chars = null;
        }
        return this;
    }