Skip to content

Commit

Permalink
Fix variable integer encodings (gavofyork#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
gavofyork authored Jul 15, 2024
1 parent 70aa907 commit dc00659
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion text/serialization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ \subsubsection{Integer Encoding}
\se_{4*}\colon\left\{\begin{aligned}
\N_{2^{29}} &\to \Y_{1:4} \\
x &\mapsto \begin{cases}
[0] &\when x = 0 \\
\left[2^8-2^{8-l} + \ffrac{x}{2^{8l}}\right] \concat \se_l(x \bmod 2^{8l}) &\when \exists l \in \N_3 : 2^{7l} \le x < 2^{7(l+1)} \\
\left[2^8-2^5 + \ffrac{x}{2^{24}}\right] \concat \se_3(x \bmod 2^{24}) &\when 2^{21} \le x < 2^{29} \\
\end{cases}
Expand All @@ -53,8 +54,9 @@ \subsubsection{Integer Encoding}
\se\colon\left\{\begin{aligned}
\N_{2^{64}} &\to \Y_{1:9} \\
x &\mapsto \begin{cases}
[0] &\when x = 0 \\
\left[2^8-2^{8-l} + \ffrac{x}{2^{8l}}\right] \concat \se_l(x \bmod 2^{8l}) &\when \exists l \in \N_8 : 2^{7l} \le x < 2^{7(l+1)} \\
[2^8-1] \concat \se_8(x) &\when x < 2^{64} \\
[2^8-1] \concat \se_8(x) &\otherwhen x < 2^{64} \\
\end{cases}
\end{aligned}\right.
\end{equation}
Expand Down

0 comments on commit dc00659

Please sign in to comment.