This commit is contained in:
codemasher
2020-11-22 10:28:51 +01:00
parent 4aec4d2c3c
commit 6dd66bf620
3 changed files with 10 additions and 4 deletions
+2
View File
@@ -14,6 +14,8 @@ namespace chillerlan\QRCode\Common;
use chillerlan\QRCode\QRCodeException;
use function array_column, array_combine, array_keys;
/**
*/
class EccLevel{
+2 -4
View File
@@ -1,5 +1,6 @@
<?php
/**
* Class Version
*
* @filesource Version.php
* @created 19.11.2020
@@ -11,13 +12,10 @@
namespace chillerlan\QRCode\Common;
use chillerlan\QRCode\QRCode;
use chillerlan\QRCode\QRCodeException;
use function array_column, array_combine, array_keys;
/**
* Class Version
*
*/
class Version{
+6
View File
@@ -196,10 +196,16 @@ class QRData{
}
// Padding: ISO/IEC 18004:2000 8.4.9 Bit stream to codeword conversion
// if the final codeword is not exactly 8 bits in length, it shall be made 8 bits long
// by the addition of padding bits with binary value 0
while($this->bitBuffer->getLength() % 8 !== 0){
$this->bitBuffer->putBit(false);
}
// The message bit stream shall then be extended to fill the data capacity of the symbol
// corresponding to the Version and Error Correction Level, by the addition of the Pad
// Codewords 11101100 and 00010001 alternately.
while(true){
if($this->bitBuffer->getLength() >= $MAX_BITS){