Handbook
Glossary
encode-integer ( first-byte int prefix-length -- bytes )
Vocabulary
http2
.
hpack
.
private
Inputs
first-byte
an
object
int
an
object
prefix-length
an
object
Outputs
bytes
an
object
Definition
USING:
byte-arrays
byte-vectors
kernel
math
sequences
;
IN:
http2.hpack.private
:
encode-integer
( first-byte int prefix-length -- bytes )
2^
1
-
2dup
<
[
drop
bitor
1byte-array
]
[
tuck
[
bitor
1byte-array
>byte-vector
]
[
-
]
2bi*
[
dup
128
>=
]
[
[
128
mod
128
+
over
push
]
[
128
/i
]
bi
]
while
over
push
>byte-array
]
if
;