I was reading up on how to convert strings to integer representations for RSA encryption. See this link. Basically, the string-to-integer conversion goes as follows:
a(char_1)*256^n + a(char_2)*256^(n-1) + ... + a(char_n)*256^0
where
n = string length
a(char) = ASCII representation of the character
My question is how you would convert from the integer back to the original string. This link says to perform the inverse of the original algorithm, but I don't know how I would go about doing that.
Given a value such as $1415934836.00$ and an expression such as:
$$(x_{3})*256^3+(x_{2})*256^2+(x_{1})*256^1+(x_{0})*256^0=1415934836.00$$
You can perform the iterations below to get the values $x_{i}$ from the second column of the table below (where base=256)
So we get:
$$(84)*256^3+(101)*256^2+(115)*256^1+(116)*256^0=1415934836.00$$
Notice how similar this is to converting numbers between bases.