Skip to main content
Commonmark migration
Source Link

#Use C for base compression

Use C for base compression

This is actually undocumented, C on a string is actually not direct chr -> int but instead base 256 -> base 10 (which is the same on one char strings). This is hugely helpful in compressing an int, we can use this script to compress:

sCMjQ256 

Take 12345678910, it results in ßÜ> (some unprintables in there).

Also with an array of ints, you can concatenate them, and with large strings by converting to code points and treating as base 128 number.

Another usage of C, thanks @xnor for showing me this, is making an arbitrary large number. The naive way is:

^TT 

But we can do one byte better with:

CG 

this base 256 deconverts the entire alphabet. Results 156490583352162063278528710879425690470022892627113539022649722 = ~1.56e62.

#Use C for base compression

This is actually undocumented, C on a string is actually not direct chr -> int but instead base 256 -> base 10 (which is the same on one char strings). This is hugely helpful in compressing an int, we can use this script to compress:

sCMjQ256 

Take 12345678910, it results in ßÜ> (some unprintables in there).

Also with an array of ints, you can concatenate them, and with large strings by converting to code points and treating as base 128 number.

Another usage of C, thanks @xnor for showing me this, is making an arbitrary large number. The naive way is:

^TT 

But we can do one byte better with:

CG 

this base 256 deconverts the entire alphabet. Results 156490583352162063278528710879425690470022892627113539022649722 = ~1.56e62.

Use C for base compression

This is actually undocumented, C on a string is actually not direct chr -> int but instead base 256 -> base 10 (which is the same on one char strings). This is hugely helpful in compressing an int, we can use this script to compress:

sCMjQ256 

Take 12345678910, it results in ßÜ> (some unprintables in there).

Also with an array of ints, you can concatenate them, and with large strings by converting to code points and treating as base 128 number.

Another usage of C, thanks @xnor for showing me this, is making an arbitrary large number. The naive way is:

^TT 

But we can do one byte better with:

CG 

this base 256 deconverts the entire alphabet. Results 156490583352162063278528710879425690470022892627113539022649722 = ~1.56e62.

Source Link
Maltysen
  • 25.8k
  • 4
  • 56
  • 127

#Use C for base compression

This is actually undocumented, C on a string is actually not direct chr -> int but instead base 256 -> base 10 (which is the same on one char strings). This is hugely helpful in compressing an int, we can use this script to compress:

sCMjQ256 

Take 12345678910, it results in ßÜ> (some unprintables in there).

Also with an array of ints, you can concatenate them, and with large strings by converting to code points and treating as base 128 number.

Another usage of C, thanks @xnor for showing me this, is making an arbitrary large number. The naive way is:

^TT 

But we can do one byte better with:

CG 

this base 256 deconverts the entire alphabet. Results 156490583352162063278528710879425690470022892627113539022649722 = ~1.56e62.