protected function bstr2bin($input) { // Unpack as a hexadecimal string $value = $this->str2hex($input); // Output binary representation return base_convert($value, 16, 2); }