public function count()
{
$count = 0;
$byteLen = strlen($this->bitset);
for ($bytePos = 0; $bytePos < $byteLen; ++$bytePos) {
if ($this->bitset[$bytePos] === "") {
continue;
// fast skip null byte
}
for ($bitPos = 0; $bitPos < 8; ++$bitPos) {
if ((ord($this->bitset[$bytePos]) & 1 << $bitPos) !== 0) {
++$count;
}
}
}
return $count;
}