File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -91,5 +91,25 @@ parsed_data = Parser().parse(test_target)
9191>> [ParsedResult(field=1, wire_type="string", data='✊')]
9292```
9393
94+ # Nested Protobuf Detection Logic
95+ Our project implements a distinct method to determine whether a given input is possibly a nested protobuf.
96+ The core of this logic is the ` is_maybe_nested_protobuf ` function.
97+ We recently enhanced this function to provide a more accurate distinction and handle nested protobufs effectively.
98+
99+ ### Current Logic
100+ The ` is_maybe_nested_protobuf ` function works by:
101+
102+ - Attempting to convert the given hex string to UTF-8.
103+ - Checking the ordinal values of the first four characters of the converted data.
104+ - Returning ` True ` if the data might be a nested protobuf based on certain conditions, otherwise returning False.
105+
106+ ### Extensibility
107+ You can extend or modify the ` is_maybe_nested_protobuf ` function based on your specific requirements or use-cases.
108+ If you find a scenario where the current logic can be further improved,
109+ feel free to adapt the function accordingly.
110+
111+ (A big shoutout to ** @fuzzyrichie ** for their significant contributions to this update!)
112+
113+
94114# Reference
95115- [ Google protocol-buffers encoding document] ( https://developers.google.com/protocol-buffers/docs/encoding )
You can’t perform that action at this time.
0 commit comments