Lines Matching refs:tag
235 # The first byte of a tag always contains the class (bits 8 and 7) and whether it is constructed (bit 6).
236 $tag = $type->getTagClass() | ($type->getIsConstructed() ? AbstractType::CONSTRUCTED_TYPE : 0);
239 # For a high tag (>=31) we flip the first 5 bits on (0x1f) to make the first byte, then the subsequent bytes is
240 # the VLV encoding of the tag number.
242 $bytes = chr($tag | 0x1f) . $this->intToVlqBytes($type->getTagNumber()) . $bytes;
243 # For a tag less than 31, everything fits comfortably into a single byte.
245 $bytes = chr($tag | $type->getTagNumber()) . $bytes;
252 * Map universal types to specific tag class values when decoding.
332 $tag = ord($this->binary[$this->pos++]);
333 $class = $tag & 0xc0;
334 $isConstructed = (bool)($tag & AbstractType::CONSTRUCTED_TYPE);
335 $tagNumber = $tag & ~0xe0;
337 # Less than or equal to 30 is a low tag number represented in a single byte.
338 # A high tag number is determined using VLQ (like the OID identifier encoding) of the subsequent bytes.
342 # It's possible we only got part of the VLQ for the high tag, as there is no way to know its ending length.
346 'Not enough data to decode the high tag number. No ending byte encountered for the VLQ bytes.'
502 throw new EncoderException(sprintf('Unable to decode value to a type for tag %s.', $tagType));