Creates a octet key with the given key size and additional values.

@param int   $size   The key size in bits
@param array $values values to configure the key
965927
public static function createOctKey(int $size, array $values = []): JWK
    {
        if (0 !== $size % 8) {
            throw new InvalidArgumentException('Invalid key size.');
        }
        $values = \array_merge(
            $values,
            [
                'kty' => 'oct',
                'k' => Base64Url::encode(\random_bytes($size / 8)),
            ]
        );

        return new JWK($values);
    }
1286107
public function size(string $size): self
    {
        $comparator = new Comparator\NumberComparator($size);
        $filter = new Iterator\SizeRangeFilterIterator($this->getIterator(), [$comparator]);

        return new self(iterator_to_array($filter));
    }
579896
public static function createFromValues(array $values)
    {
        if (\array_key_exists('keys', $values) && \is_array($values['keys'])) {
            return JWKSet::createFromKeyData($values);
        }

        return JWK::create($values);
    }
865712
public function assignMultiple(array $values)
    {
        foreach ($values as $key => $value) {
            $this->assign($key, $value);
        }
        return $this;
    }
788632
public function ensureCapacity(int $size) : void
    {
        if ($size > count($this->bits) << 5) {
            $this->bits->setSize(($size + 31) >> 5);
        }
    }
609885
public function setSize($size = 32)
    {
        $size = (int)$size;

        // Gravatars can be sized 1px up to 2048px square: https://en.gravatar.com/site/implement/images/#size
        if ($size < 1) {
            $size = 1;
        }

        if ($size > 2048) {
            $size = 2048;
        }

        $this->size = $size;

        return $this;
    }
393002
public final void setToSize(int size) {
    
    int newMap[] = new int[size];

    System.arraycopy(m_map, 0, newMap, 0, m_map[m_lengthPos]);

    m_mapSize = size;
    m_map = newMap;
    
  }
990811
public function tally($size)
	{
		$this->size = number_format($this->size + $size, 2, '.', '');
		$this->count++;
	}
642600
public function setSize($size = null) {
        $this->_size = is_int($size)? $size : self::DEFAULT_SIZE;
    }
792565
public static function parseSize($size)
    {
        $height = null;
        $width = null;

        if (count((array) $size) == 2 || strpos($size, 'x')) {
            list($width, $height) = is_array($size) ? $size : explode('x', $size);
        } else {
            $size = (array) $size;
            $width = (int) $size[0];
        }

        return array($width,$height);
    }
594526
public function setSize( $size ){
		if( !is_integer( $size ) )
			throw new InvalidArgumentException( 'Size must be an integer' );
		if( $size < 1 )
			throw new OutOfBoundsException( 'Size must be atleast 1 pixel' );
		if( $size > 512 )
			throw new OutOfBoundsException( 'Size must be atmost 512 pixels' );
		$this->size	= $size;
	}
1076603
public function pad($size, $value)
    {
        $this->items = \array_pad($this->items, $size, $value);

        return $this;
    }
1129056
protected function setValue(array $values)
    {
        foreach ($values as $key => $value) {
            if (($this->type !== gettype($value)) && (!$value instanceof $this->type)) {
                return new Failure(new \RuntimeException("Value {$key} is not a {$this->type}"));
            }
        }

        return new Success($values);
    }
1183675
private static function decryptBlock($input, $key, $size){
		$output = array();
		$block = array(); /* the 128 bit block to decode */
		$nbrRounds = self::numberOfRounds($size);
		/* Set the block values, for the block:
		 * a0,0 a0,1 a0,2 a0,3
		 * a1,0 a1,1 a1,2 a1,3
		 * a2,0 a2,1 a2,2 a2,3
		 * a3,0 a3,1 a3,2 a3,3
		 * the mapping order is a0,0 a1,0 a2,0 a3,0 a0,1 a1,1 ... a2,3 a3,3
		 */
		for ($i = 0; $i < 4; $i++) /* iterate over the columns */
			for ($j = 0; $j < 4; $j++) /* iterate over the rows */
				$block[($i+($j*4))] = $input[($i*4)+$j];
		/* expand the key into an 176, 208, 240 bytes key */
		$expandedKey = self::expandKey($key, $size);
		/* decrypt the block using the expandedKey */
		$block = self::invMain($block, $expandedKey, $nbrRounds);
		for ($k = 0; $k < 4; $k++)/* unmap the block again into the output */
			for ($l = 0; $l < 4; $l++)/* iterate over the rows */
				$output[($k*4)+$l] = $block[($k+($l*4))];
		return $output;
	}
1132135
private function getCacheKey(array $size, $mode)
    {
        list($width, $height) = $size;

        return md5($width . $height . $mode);
    }
522764
public static function _toReadableSize($size, $decimals = '.') {
		$size = parent::toReadableSize($size);
		if ($decimals !== '.') {
			$size = str_replace('.', $decimals, $size);
		}
		return $size;
	}
540314
public function setFileSize($size)
    {
        if ($size === null) {
            $this->fileSize = null;

            return $this;
        }

        if (!is_numeric($size)) {
            throw new InvalidArgumentException('File size must be an integer or a float.');
        }

        $this->fileSize = $size;

        return $this;
    }