Joan Venge
Joan Venge

Reputation: 331440

Is there a way to decompress a javascript file?

I have a js where the contents look like this:

HTTP/1.1 200 OK
Date: Fri, 02 Dec 2011 03:40:37 GMT
Server: Apache/2.2.3 (CentOS)
Vary: Accept-Encoding
Last-Modified: Fri, 12 Jun 2011 02:36:40 GMT
ETag: "7812e-1228-4a5df9820de00"
Accept-Ranges: bytes
Content-Type: application/x-javascript
Content-Encoding: gzip
Content-Length: 2009

and then a wall of:

00000000:  5e  01  00  00  02  08  00  00  e0  ff  d2  d4  36  12  2e  00  ^...........6...

Since there is mention of gzip, I assume this is a compressed javascript file?

Or is this some sort of encryption?

Upvotes: 2

Views: 233

Answers (2)

Manjula
Manjula

Reputation: 5101

It is a gzip compressed javascript file. You may be able to view it using Firebug extension in Firefox.

Upvotes: 2

sarnold
sarnold

Reputation: 104090

gzip -cd on the data should be sufficient to decompress it.

The compression used is the same as zlib in case you want an API to decompress your data.

Upvotes: 2

Related Questions