How to represent a integer by a chain of 8 bit numbers [closed]
up vote
-2
down vote
favorite
I am wondering how you can represent an integer as a chain of 8-bit numbers. That is, (and I don't know how to actually calculate this so the example is wrong, but should demonstrate the basic idea), say you have an integer of arbitrary size , meaning it can be extremely large like Math.pow(100, 100) ≈ 1e+200 or some small number like 1 or 0 . You want to be able to compute that number by using a chain of 8-bit values. The question is how to do that. For example, I can represent 255 like this: [ 255, 1 ] That is, our representation has the first value be 8-bits, and then the second value is also 8-bits, and we multiply them together as 255 * 1 = 255 . Another case would be 256 . We could represent that like this: [ 255, 1, 1 ] Meaning (255 * 1) + 1 = 256 , but now we don't neces