We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 651e4c5 commit 0f8f9b9Copy full SHA for 0f8f9b9
src/hpack/huffman.py
@@ -44,9 +44,8 @@ def encode(self, bytes_to_encode: bytes | None) -> bytes:
44
final_num <<= bits_to_be_padded
45
final_num |= (1 << bits_to_be_padded) - 1
46
47
- # Convert the number to hex and strip off the leading '0x' and the
48
- # trailing 'L', if present.
49
- s = hex(final_num)[2:].rstrip("L")
+ # Convert the number to hex without leading '0x' or trailing 'L'.
+ s = f"{final_num:x}"
50
51
# If this is odd, prepend a zero.
52
s = "0" + s if len(s) % 2 != 0 else s
0 commit comments