🛀 QRDataModeInterface: validate data on init, test cleanup

This commit is contained in:
codemasher
2021-11-28 18:25:06 +01:00
parent 3d563bfcc0
commit 48b6c21090
12 changed files with 71 additions and 203 deletions
+4 -7
View File
@@ -193,19 +193,16 @@ final class QRData{
// 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.
$alternate = false;
while(true){
if($this->bitBuffer->getLength() >= $MAX_BITS){
break;
}
$this->bitBuffer->put(0b11101100, 8);
if($this->bitBuffer->getLength() >= $MAX_BITS){
break;
}
$this->bitBuffer->put(0b00010001, 8);
$this->bitBuffer->put($alternate ? 0b00010001 : 0b11101100, 8);
$alternate = !$alternate;
}
}