code: private static function chunk($binaryString, $bits)
      {
          $binaryString = chunk_split($binaryString, $bits, ' ');
  
          if (substr($binaryString, (strlen($binaryString)) - 1)  == ' ') {
              $binaryString = substr($binaryString, 0, strlen($binaryString)-1);
          }
  
          return explode(' ', $binaryString);
      }
docs: Creates an array from a binary string into a given chunk size
  
  @param string $binaryString String to chunk
  @param integer $bits Number of bits per chunk
  @return array