decode-integer ( block current-index prefix-length -- block new-index number )


Vocabulary
http2.hpack.private

Inputs
blockan object
current-indexan object
prefix-lengthan object


Outputs
blockan object
new-indexan object
numberan object


Definition


:: decode-integer
( block current-index prefix-length -- block new-index number )
current-index 1 + :> end-index! current-index block nth
prefix-length 2^ 1 - [ mask ] keep over = [
current-index 1 + block [ 7 bit? not ] find-from drop
1 + end-index! current-index 1 + end-index block subseq
reverse 0 [ 127 mask swap 128 * + ] reduce +
] when [ block end-index ] dip ;