codemasher vor 5 Jahren
Ursprung
Commit
6dd66bf620
3 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. 2 0
      src/Common/EccLevel.php
  2. 2 4
      src/Common/Version.php
  3. 6 0
      src/Data/QRData.php

+ 2 - 0
src/Common/EccLevel.php

@@ -14,6 +14,8 @@ namespace chillerlan\QRCode\Common;
 
 use chillerlan\QRCode\QRCodeException;
 
+use function array_column, array_combine, array_keys;
+
 /**
  */
 class EccLevel{

+ 2 - 4
src/Common/Version.php

@@ -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 - 0
src/Data/QRData.php

@@ -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){