aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/bacon
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-09 10:55:03 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-09 13:09:38 +0100
commit04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa (patch)
tree5c691241355c943a3c68ddb06b8cf8c60aa11319 /srcs/phpmyadmin/vendor/bacon
parent7e0d85db834d6351ed85d01e5126ac31dc510b86 (diff)
downloadft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.gz
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.bz2
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.zip
phpmyadmin working
Diffstat (limited to 'srcs/phpmyadmin/vendor/bacon')
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/CHANGELOG.md37
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/LICENSE22
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/README.md39
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/composer.json32
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitArray.php372
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitMatrix.php313
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitUtils.php41
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/CharacterSetEci.php180
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/EcBlock.php49
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/EcBlocks.php74
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/ErrorCorrectionLevel.php63
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/FormatInformation.php203
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/Mode.php76
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/ReedSolomonCodec.php468
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/Version.php596
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/BlockPair.php58
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/ByteMatrix.php150
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php652
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/MaskUtil.php271
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/MatrixUtil.php513
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/QrCode.php141
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/ExceptionInterface.php10
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/InvalidArgumentException.php8
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/OutOfBoundsException.php8
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/RuntimeException.php8
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/UnexpectedValueException.php8
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Exception/WriterException.php8
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Color/Alpha.php57
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Color/Cmyk.php103
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Color/ColorInterface.php22
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Color/Gray.php46
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Color/Rgb.php88
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/CompositeEye.php38
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/EyeInterface.php26
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/ModuleEye.php54
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SimpleCircleEye.php54
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Eye/SquareEye.php53
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Image/EpsImageBackEnd.php376
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Image/ImageBackEndInterface.php87
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Image/ImagickImageBackEnd.php339
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Image/SvgImageBackEnd.php369
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Image/TransformationMatrix.php67
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/ImageRenderer.php152
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/DotsModule.php63
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/EdgeIterator/Edge.php100
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/EdgeIterator/EdgeIterator.php169
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/ModuleInterface.php18
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/RoundnessModule.php129
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Module/SquareModule.php47
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/Close.php29
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/Curve.php92
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/EllipticArc.php278
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/Line.php41
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/Move.php41
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/OperationInterface.php12
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/Path/Path.php106
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/PlainTextRenderer.php86
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererInterface.php11
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/EyeFill.php74
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/Fill.php168
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/Gradient.php46
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/GradientType.php22
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/RendererStyle.php90
-rw-r--r--srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Writer.php68
64 files changed, 8021 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/CHANGELOG.md b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/CHANGELOG.md
new file mode 100644
index 0000000..3409ee6
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/CHANGELOG.md
@@ -0,0 +1,37 @@
+# Changelog
+
+All notable changes to this project will be documented in this file, in reverse chronological order by release.
+
+## 2.0.0 - 2018-04-25
+
+### Added
+
+- [#25](https://github.com/Bacon/BaconQrCode/pull/25) allows for setting a more compact text output
+
+- CHANGELOG.md added (how meta)
+
+- Allows more complex shapes for modules
+
+- Allows setting a gradient for the foreground
+
+- Allows transparent backgrounds and alpha channel on all colors
+
+### Changed
+
+- Minimum PHP version changed to 7.1
+
+- Imagick renderer now allows setting different output formats
+
+- New optimized SVG renderer
+
+### Deprecated
+
+- Nothing.
+
+### Removed
+
+- Legacy ZF module support removed
+
+### Fixed
+
+- Non-release files are excluded from composer packages
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/LICENSE b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/LICENSE
new file mode 100644
index 0000000..d45a356
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2017, Ben Scholzen 'DASPRiD'
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/README.md b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/README.md
new file mode 100644
index 0000000..ba006c1
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/README.md
@@ -0,0 +1,39 @@
+# QR Code generator
+
+[![Build Status](https://api.travis-ci.org/Bacon/BaconQrCode.png?branch=master)](http://travis-ci.org/Bacon/BaconQrCode)
+[![Coverage Status](https://coveralls.io/repos/github/Bacon/BaconQrCode/badge.svg?branch=master)](https://coveralls.io/github/Bacon/BaconQrCode?branch=master)
+[![Latest Stable Version](https://poser.pugx.org/bacon/bacon-qr-code/v/stable)](https://packagist.org/packages/bacon/bacon-qr-code)
+[![Total Downloads](https://poser.pugx.org/bacon/bacon-qr-code/downloads)](https://packagist.org/packages/bacon/bacon-qr-code)
+[![License](https://poser.pugx.org/bacon/bacon-qr-code/license)](https://packagist.org/packages/bacon/bacon-qr-code)
+
+
+## Introduction
+BaconQrCode is a port of QR code portion of the ZXing library. It currently
+only features the encoder part, but could later receive the decoder part as
+well.
+
+As the Reed Solomon codec implementation of the ZXing library performs quite
+slow in PHP, it was exchanged with the implementation by Phil Karn.
+
+
+## Example usage
+```php
+use BaconQrCode\Renderer\ImageRenderer;
+use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
+use BaconQrCode\Renderer\RendererStyle\RendererStyle;
+use BaconQrCode\Writer;
+
+$renderer = new ImageRenderer(
+ new RendererStyle(400),
+ new ImagickImageBackEnd()
+);
+$writer = new Writer($renderer);
+$writer->writeFile('Hello World!', 'qrcode.png');
+```
+
+## Available image renderer back ends
+BaconQrCode comes with multiple back ends for rendering images. Currently included are the following:
+
+- `ImagickImageBackEnd`: renders raster images using the Imagick library
+- `SvgImageBackEnd`: renders SVG files using XMLWriter
+- `EpsImageBackEnd`: renders EPS files
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/composer.json b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/composer.json
new file mode 100644
index 0000000..d66d586
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "bacon/bacon-qr-code",
+ "description": "BaconQrCode is a QR code generator for PHP.",
+ "license" : "BSD-2-Clause",
+ "homepage": "https://github.com/Bacon/BaconQrCode",
+ "require": {
+ "php": "^7.1",
+ "ext-iconv": "*",
+ "dasprid/enum": "^1.0"
+ },
+ "suggest": {
+ "ext-imagick": "to generate QR code images"
+ },
+ "authors": [
+ {
+ "name": "Ben Scholzen 'DASPRiD'",
+ "email": "mail@dasprids.de",
+ "homepage": "http://www.dasprids.de",
+ "role": "Developer"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "BaconQrCode\\": "src/"
+ }
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.4",
+ "squizlabs/php_codesniffer": "^3.1",
+ "phly/keep-a-changelog": "^1.4"
+ }
+}
diff --git a/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitArray.php b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitArray.php
new file mode 100644
index 0000000..158384f
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/BitArray.php
@@ -0,0 +1,372 @@
+<?php
+declare(strict_types = 1);
+
+namespace BaconQrCode\Common;
+
+use BaconQrCode\Exception\InvalidArgumentException;
+use SplFixedArray;
+
+/**
+ * A simple, fast array of bits.
+ */
+final class BitArray
+{
+ /**
+ * Bits represented as an array of integers.
+ *
+ * @var SplFixedArray<int>
+ */
+ private $bits;
+
+ /**
+ * Size of the bit array in bits.
+ *
+ * @var int
+ */
+ private $size;
+
+ /**
+ * Creates a new bit array with a given size.
+ */
+ public function __construct(int $size = 0)
+ {
+ $this->size = $size;
+ $this->bits = SplFixedArray::fromArray(array_fill(0, ($this->size + 31) >> 3, 0));
+ }
+
+ /**
+ * Gets the size in bits.
+ */
+ public function getSize() : int
+ {
+ return $this->size;
+ }
+
+ /**
+ * Gets the size in bytes.
+ */
+ public function getSizeInBytes() : int
+ {
+ return ($this->size + 7) >> 3;
+ }
+
+ /**
+ * Ensures that the array has a minimum capacity.
+ */
+ public function ensureCapacity(int $size) : void
+ {
+ if ($size > count($this->bits) << 5) {
+ $this->bits->setSize(($size + 31) >> 5);
+ }
+ }
+
+ /**
+ * Gets a specific bit.
+ */
+ public function get(int $i) : bool
+ {
+ return 0 !== ($this->bits[$i >> 5] & (1 << ($i & 0x1f)));
+ }
+
+ /**
+ * Sets a specific bit.
+ */
+ public function set(int $i) : void
+ {
+ $this->bits[$i >> 5] = $this->bits[$i >> 5] | 1 << ($i & 0x1f);
+ }
+
+ /**
+ * Flips a specific bit.
+ */
+ public function flip(int $i) : void
+ {
+ $this->bits[$i >> 5] ^= 1 << ($i & 0x1f);
+ }
+
+ /**
+ * Gets the next set bit position from a given position.
+ */
+ public function getNextSet(int $from) : int
+ {
+ if ($from >= $this->size) {
+ return $this->size;
+ }
+
+ $bitsOffset = $from >> 5;
+ $currentBits = $this->bits[$bitsOffset];
+ $bitsLength = count($this->bits);
+ $currentBits &= ~((1 << ($from & 0x1f)) - 1);
+
+ while (0 === $currentBits) {
+ if (++$bitsOffset === $bitsLength) {
+ return $this->size;
+ }
+
+ $currentBits = $this->bits[$bitsOffset];
+ }
+
+ $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
+ return $result > $this->size ? $this->size : $result;
+ }
+
+ /**
+ * Gets the next unset bit position from a given position.
+ */
+ public function getNextUnset(int $from) : int
+ {
+ if ($from >= $this->size) {
+ return $this->size;
+ }
+
+ $bitsOffset = $from >> 5;
+ $currentBits = ~$this->bits[$bitsOffset];
+ $bitsLength = count($this->bits);
+ $currentBits &= ~((1 << ($from & 0x1f)) - 1);
+
+ while (0 === $currentBits) {
+ if (++$bitsOffset === $bitsLength) {
+ return $this->size;
+ }
+
+ $currentBits = ~$this->bits[$bitsOffset];
+ }
+
+ $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
+ return $result > $this->size ? $this->size : $result;
+ }
+
+ /**
+ * Sets a bulk of bits.
+ */
+ public function setBulk(int $i, int $newBits) : void
+ {
+ $this->bits[$i >> 5] = $newBits;
+ }
+
+ /**
+ * Sets a range of bits.
+ *
+ * @throws InvalidArgumentException if end is smaller than start
+ */
+ public function setRange(int $start, int $end) : void
+ {
+ if ($end < $start) {
+ throw new InvalidArgumentException('End must be greater or equal to start');
+ }
+
+ if ($end === $start) {
+ return;
+ }
+
+ --$end;
+
+ $firstInt = $start >> 5;
+ $lastInt = $end >> 5;
+
+ for ($i = $firstInt; $i <= $lastInt; ++$i) {
+ $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
+ $lastBit = $i < $lastInt ? 31 : $end & 0x1f;
+
+ if (0 === $firstBit && 31 === $lastBit) {
+ $mask = 0x7fffffff;
+ } else {
+ $mask = 0;
+
+ for ($j = $firstBit; $j < $lastBit; ++$j) {
+ $mask |= 1 << $j;
+ }
+ }
+
+ $this->bits[$i] = $this->bits[$i] | $mask;
+ }
+ }
+
+ /**
+ * Clears the bit array, unsetting every bit.
+ */
+ public function clear() : void
+ {
+ $bitsLength = count($this->bits);
+
+ for ($i = 0; $i < $bitsLength; ++$i) {
+ $this->bits[$i] = 0;
+ }
+ }
+
+ /**
+ * Checks if a range of bits is set or not set.
+
+ * @throws InvalidArgumentException if end is smaller than start
+ */
+ public function isRange(int $start, int $end, bool $value) : bool
+ {
+ if ($end < $start) {
+ throw new InvalidArgumentException('End must be greater or equal to start');
+ }
+
+ if ($end === $start) {
+ return true;
+ }
+
+ --$end;
+
+ $firstInt = $start >> 5;
+ $lastInt = $end >> 5;
+
+ for ($i = $firstInt; $i <= $lastInt; ++$i) {
+ $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
+ $lastBit = $i < $lastInt ? 31 : $end & 0x1f;
+
+ if (0 === $firstBit && 31 === $lastBit) {
+ $mask = 0x7fffffff;
+ } else {
+ $mask = 0;
+
+ for ($j = $firstBit; $j <= $lastBit; ++$j) {
+ $mask |= 1 << $j;
+ }
+ }
+
+ if (($this->bits[$i] & $mask) !== ($value ? $mask : 0)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Appends a bit to the array.
+ */
+ public function appendBit(bool $bit) : void
+ {
+ $this->ensureCapacity($this->size + 1);
+
+ if ($bit) {
+ $this->bits[$this->size >> 5] = $this->bits[$this->size >> 5] | (1 << ($this->size & 0x1f));
+ }
+
+ ++$this->size;
+ }
+
+ /**
+ * Appends a number of bits (up to 32) to the array.
+
+ * @throws InvalidArgumentException if num bits is not between 0 and 32
+ */
+ public function appendBits(int $value, int $numBits) : void
+ {
+ if ($numBits < 0 || $numBits > 32) {
+ throw new InvalidArgumentException('Num bits must be between 0 and 32');
+ }
+
+ $this->ensureCapacity($this->size + $numBits);
+
+ for ($numBitsLeft = $numBits; $numBitsLeft > 0; $numBitsLeft--) {
+ $this->appendBit((($value >> ($numBitsLeft - 1)) & 0x01) === 1);
+ }
+ }
+
+ /**
+ * Appends another bit array to this array.
+ */
+ public function appendBitArray(self $other) : void
+ {
+ $otherSize = $other->getSize();
+ $this->ensureCapacity($this->size + $other->getSize());
+
+ for ($i = 0; $i < $otherSize; ++$i) {
+ $this->appendBit($other->get($i));
+ }
+ }
+
+ /**
+ * Makes an exclusive-or comparision on the current bit array.
+ *
+ * @throws InvalidArgumentException if sizes don't match
+ */
+ public function xorBits(self $other) : void
+ {
+ $bitsLength = count($this->bits);
+ $otherBits = $other->getBitArray();
+
+ if ($bitsLength !== count($otherBits)) {
+ throw new InvalidArgumentException('Sizes don\'t match');
+ }
+
+ for ($i = 0; $i < $bitsLength; ++$i) {
+ $this->bits[$i] = $this->bits[$i] ^ $otherBits[$i];
+ }
+ }
+
+ /**
+ * Converts the bit array to a byte array.
+ *
+ * @return SplFixedArray<int>
+ */
+ public function toBytes(int $bitOffset, int $numBytes) : SplFixedArray
+ {
+ $bytes = new SplFixedArray($numBytes);
+
+ for ($i = 0; $i < $numBytes; ++$i) {
+ $byte = 0;
+
+ for ($j = 0; $j < 8; ++$j) {
+ if ($this->get($bitOffset)) {
+ $byte |= 1 << (7 - $j);
+ }
+
+ ++$bitOffset;
+ }
+
+ $bytes[$i] = $byte;
+ }
+
+ return $bytes;