The current constructor of BitString is forced to use DEFAULT_BYTE_SIZE, which does not always match people's need. It'd be nice and simple to allow initialization with customized size:
/**
* @param int $size
*/
public function __construct(int size=self::DEFAULT_BYTE_SIZE)
{
$this->size = $size;
$this->bytes = str_repeat(chr(0), $this->size);
}
Currently I'm forced to create an all-zeros string myself, and call createFromString, which is not very ideal
The current constructor of
BitString
is forced to useDEFAULT_BYTE_SIZE
, which does not always match people's need. It'd be nice and simple to allow initialization with customized size:Currently I'm forced to create an all-zeros string myself, and call
createFromString
, which is not very ideal