|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
javascript sourcecode compression
for not reinventing the wheel ... is there an out-of-the-box library for
compressing javascript sourcecode (probably utilising huffman encoding w/ a dictionary optimised for javascript sourcecode) and doing the decompression in javascript? the task is obvious: crunch sourcecode consisting mainly of function() declarations, store the resulting string in [wherever], download the whole enchilada through j(ava)script, decompress it, and use eval(). can anyone point me to some useful resources? any help is appreciated. - niko |
|
#2
|
|||
|
|||
|
hombre:
I'm not sure what your need is, but if you have need to compress your scripts, you can compress a .js file using any old jar utility (available with any java development kit) from the command prompt. You can then reference the compressed file in the same manner that you would reference any external .js file: <script src="your_compressed_file.jar"></script> You can manually unjar the file to edit it, but there's no need (or ability for that matter) to uncompress it in your scripts. Hope this was helpful. |
|
#3
|
|||
|
|||
|
need different technique
szarecor:
thanks for you hints. so far i understand that .jar files are a way to store, eventually compress javascript source files, probably sign them, and let the browser do the uncompression/installation (if that is an applicable term) of the resulting file. now, what i'd rather need is a technique which allows me to compress sourcecode and leave the compressed file in a way not too easily understandable by the average script ripper. you see, the point is: i'm currently developing quite a huge javascript application (> 40kb w/o comments, unnecessary whitespace stripped), divided into separate libraries, each one loaded on demand (not by a <script> tag but using a different technique). the library code will be dispersed among a bunch of additional resource files (images etc.) with an extension other than .js that means : compression + obfuscation ;o) as i'm putting quite a heavy effort into building the application, i'm also aware of the fact that a skilled js-programmer will be able to get a clue of what's going on and extract the full code, no matter what the 'protection' is. for that reason, i'm looking for some sort of compression which (a) provides c/c++ routines for doing the encoding in a win32 application, and (b) provides j(ava)script routines for decoding the stream. - niko |
|
#4
|
|||
|
|||
|
I have a couple of JavaScript compression and obfusticating tools links on my tools page at:
http://javascript.about.com/cs/tools/index.htm
__________________
Robert Dominy About Guide for JavaScript http://javascript.about.com Software Consulting & Development http://www.angusog.com |
|
#5
|
|||
|
|||
|
Are you willing to wait?
__________________
Michael
|
|
#6
|
|||
|
|||
|
Also, jar files are typically used for Java not JavaScript. Keep in mind these are two totally different languages. I can't imagine any scenarios where you would put JavaScript files into a .jar file.
|
|
#7
|
|||
|
|||
|
What about signing scripts?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > javascript sourcecode compression |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|