Skip to content

Commit 657e8f0

Browse files
committed
Update README.md
Update coverage badge
1 parent 9ad4f7c commit 657e8f0

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

coverage.svg

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)