Enumerates the bytes of the supplied bytearray and updates the CRC-64.
           No return value.
184384
def update(self, content):
        

        for byte in content:
            self._crc64 = (self._crc64 >> 8) ^ self._lookup_table[(self._crc64 & 0xff) ^ byte]
899018
def enc_byte(self):
        """"""
        try:
            c = self.encdata[self.encpos]
            self.encpos += 1
            return c
        except IndexError:
            self.failed = 1
            return 0
1265729
def _long_to_bytes(n, length, byteorder):
    
    if byteorder == 'little':
        indexes = range(length)
    else:
        indexes = reversed(range(length))
    return bytearray((n >> i * 8) & 0xff for i in indexes)
1225134
static public byte[] asBytes(int value) {

        if (0 > value) {
            throw new IllegalArgumentException("value cannot be less than zero");
        }

        byte[] result = new byte[4];
        result[0] = (byte) ((value >>> 24) & 0xFF);
        result[1] = (byte) ((value >>> 16) & 0xFF);
        result[2] = (byte) ((value >>> 8) & 0xFF);
        result[3] = (byte) ((value) & 0xFF);
        return result;
    }
1031954
public static int bytesToInt(final byte[] arr) {
    int v = 0;
    for (int i = 0; i < 4; i++) {
      v |= (arr[i] & 0XFF) << (i * 8);
    }
    return v;
  }
788219
public void update(byte buffer[], int offset, int length)
	{
		int index, partlen, i, start;

		/* Length can be told to be shorter, but not inter */
		if ((length - offset) > buffer.length)
			length = buffer.length - offset;

		/* compute number of bytes mod 64 */
		index = (int) (state.count & 0x3f);
		state.count += length;

		partlen = 64 - index;

		if (length >= partlen)
		{
			int[] decode_buf = new int[16];
			if (partlen == 64)
			{
				partlen = 0;
			}
			else
			{
				for (i = 0; i < partlen; i++)
					state.buffer[i + index] = buffer[i + offset];
				transform(state, state.buffer, 0, decode_buf);
			}
			
			for (i = partlen; (i + 63) < length; i += 64)
			{
				transform(state, buffer, i + offset, decode_buf);
			}

			index = 0;
		}
		else
			i = 0;

		/* buffer remaining input */
		if (i < length)
		{
			start = i;
			for (; i < length; i++)
				state.buffer[index + i - start] = buffer[i + offset];
		}
	}
127348
private static String byteArrayToHexString(byte[] bytes) {
        StringBuilder sb = new StringBuilder(bytes.length * 2);
        for (byte element : bytes) {
            int v = element & 0xff;
            if (v < 16) {
                sb.append('0');
            }
            sb.append(Integer.toHexString(v));
        }
        return sb.toString();
    }
1291047
public static Value bytesArray(@Nullable Iterable<ByteArray> v) {
    return new BytesArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }
787755
@Override
	public ByteArray encodeAsByteArray() throws IOException {
		final int size = messages.size();
		if(size == 0) return ByteArray.EMPTY_BYTE_ARRAY;

		AoByteArrayOutputStream bout = new AoByteArrayOutputStream();
		try {
			try (DataOutputStream out = new DataOutputStream(bout)) {
				out.writeInt(size);
				int count = 0;
				for(Message message : messages) {
					count++;
					ByteArray byteArray = message.encodeAsByteArray();
					final int capacity = byteArray.size;
					out.writeByte(message.getMessageType().getTypeByte());
					out.writeInt(capacity);
					out.write(byteArray.array, 0, capacity);
				}
				if(count != size) throw new ConcurrentModificationException();
			}
		} finally {
			bout.close();
		}
		return new ByteArray(bout.getInternalByteArray(), bout.size());
	}
241748
public static byte booleansToByte(boolean[] array) {
        if (array != null && array.length > 0) {
            byte b = 0;
            for (int i = 0; i <= 7; i++) {
                if (array[i]) {
                    int nn = (1 << (7 - i));
                    b += nn;
                }
            }
            return b;
        }
        return 0;
    }
1340928
public static byte[] toUnsignedByteArray(int length, BigInteger value) {
		byte[] bytes = value.toByteArray();
		if (bytes.length == length) {
			return bytes;
		}

		int start = bytes[0] == 0 ? 1 : 0;
		int count = bytes.length - start;

		if (count > length) {
			throw new IllegalArgumentException("standard length exceeded for value");
		}

		byte[] tmp = new byte[length];
		System.arraycopy(bytes, start, tmp, tmp.length - count, count);
		return tmp;
	}
1271392
public void updateCRC() {
        this.crc32 = 0;
        CRC32 crcAlg = new CRC32();
        crcAlg.update(this.toByteArray());

        this.crc32 = (int) crcAlg.getValue();
    }
147139
static void incrementCounter(byte[] counter, byte[] oldCounter) throws GeneralSecurityException {
    System.arraycopy(counter, 0, oldCounter, 0, counter.length);
    int i = 0;
    for (; i < COUNTER_OVERFLOW_LENGTH; i++) {
      counter[i]++;
      if (counter[i] != (byte) 0x00) {
        break;
      }
    }

    if (i == COUNTER_OVERFLOW_LENGTH) {
      // Restore old counter value to ensure that encrypt and decrypt keep failing.
      System.arraycopy(oldCounter, 0, counter, 0, counter.length);
      throw new GeneralSecurityException("Counter has overflowed.");
    }
  }
1319675
def __set_byte(self, byte, lineno):
        
        if byte < 0 or byte > 255:
            error(lineno, 'Invalid byte value %i' % byte)

        self.memory_bytes[self.org] = byte
        self.index += 1
352830
def count_bytes(array):
    '''
    '''
    # this algorithm can be rewritten as
    # for i in array:
    #     count += sum(b=='1' for b in bin(i)[2:])
    # but this version is almost 2 times faster
    count = 0
    for i in array:
        i = i - ((i >> 1) & 0x55555555)
        i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
        count += (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24
    return count
741025
@Override
	public void updateBytes(final String columnLabel, final byte[] x) throws SQLException {
		wrapped.updateBytes(columnLabel, x);
	}
1096148
public static int byteArrayToInt(final byte[] byteArray, final int startPos, final int length) {
		if (byteArray == null) {
			throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
		}
		if (length <= 0 || length > 4) {
			throw new IllegalArgumentException("Length must be between 1 and 4. Length = " + length);
		}
		if (startPos < 0 || byteArray.length < startPos + length) {
			throw new IllegalArgumentException("Length or startPos not valid");
		}
		int value = 0;
		for (int i = 0; i < length; i++) {
			value += (byteArray[startPos + i] & 0xFF) << 8 * (length - i - 1);
		}
		return value;
	}