Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Thomson <mt@lowentropy.net>
  • Loading branch information
MikeBishop and martinthomson committed Oct 30, 2020
1 parent 63c950d commit 75a56bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions draft-ietf-quic-transport.md
Expand Up @@ -7491,12 +7491,12 @@ sequence of bytes to read from.

~~~
ReadVarint(data):
first_byte = data.peek()
prefix = first_byte >> 6
num_bytes = 1 << prefix
mask = (1 << (num_bytes * 8 - 2)) - 1

return data.read(num_bytes) & mask
v = data.next_byte()
length = (1 << (v >> 6))
v = v & 0x3f
repeat length-1 times:
v = (v << 8) + data.next_byte()
return v
~~~
{: #alg-varint title="Sample Variable-Length Integer Decoding Algorithm"}

Expand Down

0 comments on commit 75a56bf

Please sign in to comment.