This is a quick demo of a relatively efficient scheme for encoding arbitrary bytes (a list of integers in the range 0-255) into a single decimal string (suitable for storage in a Cloud variable). The trick is to combine pairs of bytes into a single 5-digit integer, via the formula (a + b*256). These 5-digit integers are zero-padded and concatenated to form the final encoded string. To recover the pair from the 5-digit number, simply calculate a = n mod 256, b = floor(n / 256) (or alternatively, b = n / 256 - a)
Using this scheme, it is possible to fit 102 bytes into a single 256-digit cloud variable. The theoretical maximum number of bytes you could fit is 106 (log2(10^256)/8), but that would need a more complex and slower encoding system. I believe anything more complex would be a case of "diminishing returns" - i.e. not really worth it. For example, you could fit 104 bytes by encoding 36-bit numbers into 11-digit decimals, but the math for that would be a bit nasty and harder to understand.