We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f976813 commit 2699ff9Copy full SHA for 2699ff9
src/padding_oracle/utils.py
@@ -40,7 +40,10 @@ def to_bytes(data: str | bytes | list[int]) -> bytes:
40
41
42
def to_bytes_with_default(maybe_bytes: list[int | None], default: bytes = b' ') -> bytes:
43
- return [default if b is None else b for b in maybe_bytes]
+ return bytes([
44
+ ord(default) if (b is None or b not in range(256)) else b
45
+ for b in maybe_bytes
46
+ ])
47
48
49
def to_bytes_ensure_complete(maybe_bytes: list[int | None]) -> bytes:
0 commit comments