def decode_meta_info(self, decoder: TlvDecoder) -> None: """ Decode meta info :param decoder: Decoder :return: Nothing so far """ endOffset = decoder.readNestedTlvsStart(Tlv.MetaInfo) # Does not yet parse meta data, but: # Lets the decoder jump over meta data. decoder.finishNestedTlvs(endOffset)
def decode_name(self, decoder: TlvDecoder) -> Name: """ Decode a name :param decoder: Decoder :return: Name """ endOffset = decoder.readNestedTlvsStart(Tlv.Name) comps = [] dgest = None while decoder.getOffset() < endOffset: if decoder.peekType(Tlv.ImplicitSha256DigestComponent, endOffset): dgest = decoder.readBlobTlv(Tlv.ImplicitSha256DigestComponent) dgest = dgest.tobytes() else: comps.append(self.decode_name_component(decoder)) decoder.finishNestedTlvs(endOffset) return Name(suite='ndn2013').__add__(comps).set_digest(dgest)