Extended ACSII Javascript Packer
v1.10

This page is the direct result of only a few things.
  • This 5k competition entry. The source of my single-byte token strategy (the author used CAPTIALS) and my decompession header/footer (which has evolved significantly).
  • This fully automated javascript compressor at dithered.com. The source of an automated optimal string detection routine (and the majority of the source of this page). Also finally helped me escape /slashes\ and "quotes" and deal with {[(brackets)]}.
  • And a person called Andy taking an interest.

As with the Dithered.com page, remove comments, superfluous whitespace and newlines to create a single-line file. Applications like BrainJar's Crunchinator or DOMAPI's JSCruncher help. You can't use the following characters in your source:

¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌ ÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øù

You can use the & code for them. Eg: ° for °. A nice list is here.

This page has not been significantly tested. Early testing used a single entry from the 2001 5k competition. This one, specifically its "a.htm" file. Had this compression system been used on that entry it would have come first place overall. Recent work was also checked with the Wolf5k entry (saves only roughly 500bytes, but at least it works) and the Chess entry (saved 744 bytes).

This page is designed for use with the 5k competition. Files larger than 8k are going to take quite a while unless you dial down the max string replacement size.

Source Code:

Max replacement string length:

(This greatly affects the time it takes to compress. You probably
don't want to go much above 15 if you're just screwing around.)

Compressed code: (updates as strings are replaced)

Uncompressed size: bytes
Raw compressed code size: bytes
New doc size: bytes
Replacements: (Max 88)
Last Candidate:
Last Candidate Score:
 
Current Tokens:

Version info

The latest version of this page should be available at http://www.krisjohn.net/javacomp.html
  • Pre v1.0

    Not released, string selection was manual, couldn't replace /, \, ", (, ), [, ], { or }.

  • v1.0

    First release. Automatic string selection, full support for characters that pre-1.0 tripped over.

  • v1.01

    Added half a dozen new tokens.

  • v1.02

    Removed need to manually wrap the compressed code in <script>code</script>. Added version info to page.

  • v1.03

    Updated token generating function to use sequential ASCII codes, increasing available tokens to 88. Moved to new location.

  • v1.10

    New sequential token selection and replacement system implemented, greatly reducing the size of the header required for decompression.