JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 7th, 2001, 10:21 AM
h0MBRe h0MBRe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 2 h0MBRe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 8th, 2001, 12:32 AM
szarecor szarecor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: New York
Posts: 122 szarecor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
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.

Reply With Quote
  #3  
Old August 8th, 2001, 07:55 AM
h0MBRe h0MBRe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 2 h0MBRe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old August 9th, 2001, 12:05 AM
rdominy rdominy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 81 rdominy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via ICQ to rdominy
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

Reply With Quote
  #5  
Old August 9th, 2001, 02:39 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,157 pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 h 23 m 35 sec
Reputation Power: 36
Are you willing to wait?

__________________
Michael

Reply With Quote
  #6  
Old August 9th, 2001, 02:45 AM
rdominy rdominy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 81 rdominy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via ICQ to rdominy
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.

Reply With Quote
  #7  
Old August 9th, 2001, 03:16 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,157 pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 h 23 m 35 sec
Reputation Power: 36
What about signing scripts?


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > javascript sourcecode compression

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap