Re: HPACK, Draft 09, Integer Representation

On Fri, Aug 29, 2014 at 1:00 AM, Pavel Rappo <pavel.rappo@gmail.com> wrote:

> > HPACK uses little endian.
>
> I think this difference should be mentioned explicitly.
>
>
FYI, wikipedia reference was deleted.
​
​
https://github.com/http2/http2-spec/commit/bd8d7688a9dd8708bae543a9abe889ea7797e139

​

>  > "I" is updated while loop:
> >
> >        repeat
> >            B = next octet
> >            I = I + (B & 127) * 2^M
> >
> >                      ~~~~~~~~~~~~~~~~~~~~~
> >            M = M + 7
> >        while B & 128 == 128
> >
> > So, initial "I" is not forgotten.
>
> Thanks, Tatsuhiro! It's indeed updated. I overlooked it.
>
> > "I" comes from next N bits as algorithm exactly says:
> >
> >
> > decode I from the next N bits
> >
> > HPACK integer encoding uses specific prefix bits, which is described as N
> > here in algorithm.
> > So when decoding integer encoded with 7 prefix bits, decode initial "I"
> from
> > next 7 bits.
>
> The only thing then, the meaning of "I" is different for the encoding
> and decoding parts. Isn't it?
> "The algorithm to represent an integer I is as follows:" and "For
> informational purpose, the algorithm to decode an integer I is as
> follows:". i.e. same "I" different meanings.
>
>
​If integer X is encoded to some byte string B and then B is decoded to
integer Y, then X should be equal to Y, so in that sense, both "I" mean
same integer.
For decoding algorithm, "I" in the sentence you quoted means the result of
the algorithm, and not just the first N bits.

​Best regards,
Tatsuhiro Tsujikawa​



>
>

Received on Thursday, 28 August 2014 16:12:52 UTC