I discovered this oddity:
for (long l = 4946144450195624l; l > 0; l >>= 5)
System.out.print((char) (((l & 31 | 64) % 95) + 32));
Interesting!
Standard ASCII characters which are visible are in range of 32 to 127.
That's why you see 32, and 95 (127 - 32) there.
In fact each character is mapped to 5 bits here, (you can find what is 5 bit combination for each character), and then all bits are concatenated to form a large number.
Positive longs are 63 bit numbers, large enough to hold encrypted form of 12 characters. So it is large enough to hold Hello word
, but for larger texts you shall use larger numbers, or even a BigInteger.
In an application we wanted to transfer visible English Characters, Persian Characters and Symbols via SMS. As you see there are 32 (number of Persian chars) + 95 (number of English characters and standard visible symbols) = 127
possible values, which can be represented with 7 bits.
We converted each UTF-8 (16 bit) character to 7 bits, and gain more than 56% compression ratio. So we could send texts with twice length in the same number of SMSs. (It is somehow the same thing happened here).