MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / verify

Method verify

projects/Python/proto/proto.py:1059–1068  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1057
1058 # Check if the struct value is valid
1059 def verify(self):
1060 if (self.buffer.offset + self._model.fbe_offset) > self.buffer.size:
1061 return False
1062
1063 fbe_struct_size = self.read_uint32(self._model.fbe_offset - 8)
1064 fbe_struct_type = self.read_uint32(self._model.fbe_offset - 4)
1065 if (fbe_struct_size <= 0) or (fbe_struct_type != self.fbe_type):
1066 return False
1067
1068 return (8 + self._model.verify()) == fbe_struct_size
1069
1070 # Serialize the struct value
1071 def serialize(self, value):

Callers

nothing calls this directly

Calls 2

read_uint32Method · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected