1
$\begingroup$

I was reading through this paper and came across (pg. 11 of PDF, 5 of paper) the right_encode(x) and left_encode(x) pseudo-code sections. These contained this:

Let $x_1,x_2,\ldots, x_n$ be the base-256 encoding of $x$ satisfying: $x = \Sigma \;2^{8(n-i)} x_i$, for $i = 1 $ to $n$.

What does this mean the algorithm does?

$\endgroup$
0
0
$\begingroup$

It's simply separating an integer into bytes with naive encoding. This is directly the represntation of the number, before padding length encoding etc. Think of binary representation of the number and group the bits into bytes. Those bytes are the Xi values. With X1 being the most significant and Xn being least significant.

$\endgroup$
1
  • 3
    $\begingroup$ I assume "naive encoding" means big endian here? $\endgroup$
    – Aemyl
    Jan 10 '18 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy