New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sc-compression

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sc-compression

This module allows you to compress and decompress Supercell assets. It supports the following signatures:

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-18.18%
Maintainers
1
Weekly downloads
 
Created
Source

sc-compression

This module allows you to compress and decompress Supercell assets. It supports the following signatures:

ValueSignatureComment
0NONERegular non-compressed file
1LZMAStarts with 5d 00 00
2SCStarts with SC
3SCLZStarts with SC and contains SCLZ
4SIGStarts with Sig:

The module automatically finds the right signature when decompress function is called.

Install

npm install sc-compression

Available methods

  • decompress(buffer) - returns a Buffer
  • compress(buffer, signature) - returns a Buffer
  • readSignature(buffer) - returns a file signature as a Number

Example

const { readdirSync, readFileSync, writeFileSync } = require('fs');
const { resolve } = require('path');
const ScCompression = require('sc-compression');

const directory = 'coc-13.0.4/logic';
readdirSync(directory).forEach((file) => {
    const filepath = resolve(directory, file);
    const buffer = readFileSync(filepath);
    writeFileSync(filepath, ScCompression.decompress(buffer));
});

See tests for additional implementation examples.

Step by step guide for non-developers

  • Make sure you have Node.js installed (https://nodejs.org/en/)
  • Run npm install -g sc-compression in a terminal
  • Download examples/decompress.js from this repository
  • Run node decompress.js in a terminal

FAQs

Package last updated on 22 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc