Giter Club home page Giter Club logo

smaz.js's Introduction

⚠️ Final Update: Hi folks. I created this library over 10 years ago in 2012 but I do not maintain it. This repository is archived. For a maintained version of smaz compression in Javascript, please look instead to the version provided by @remusao instead in npm as https://www.npmjs.com/package/@remusao/smaz. Thank you.







SMAZ.js

See http://github.com/antirez/smaz for information on smaz and the algorithm itself.

Live Demo: http://personalcomputer.github.com/smaz.js/

Usage

In browser:

var c = smaz.compress("string");
var u = smaz.decompress(c);

In node.js:

Installation

$ npm install smaz

How to use

var smaz = require("smaz");
var c = smaz.compress("string");
var u = smaz.decompress(c);

Compressed binary data is stored using JavaScript ArrayBuffers.

CREDITS AND LICENSE

Small was written by Salvatore Sanfilippo and is released under the BSD license. Check the COPYING file for more information. smaz.js was written by personalcomputer and is a derivative work also under the BSD license.

smaz.js's People

Contributors

ifraixedes avatar mekwall avatar personalcomputer avatar richthegeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

smaz.js's Issues

typo?

table has two "s,", but one should be "s, "

Node version

Hello ! Great library, I've seen in your package.json that you got added this requirement:

  "engines": {
    "node": ">= 0.10.x < 0.13.0"
  },

which is forbidding me to use this package on recent versions of nodeJS:
error [email protected]: The engine "node" is incompatible with this module. Expected version ">= 0.4.x < 0.7.0". Got "8.12.0"

Would it be possible to remove this part of the code in the package.json since your code seems compatible for every node version ?
Thanks in advance

encoding to bytes / hex

Hi there, how would I nicely go about encoding and decoding these compressed strings into a hex format, any tips?

Thanks!

Save compression

How can save the smaz compression in file or view the encode how string?

unicode strings garbled

This port of Smaz doesn't support the full Unicode character set. It silently outputs garbage! 😨

smaz.decompress(smaz.compress("€"))
"¬"

smaz.decompress(smaz.compress("привет мир"))
"?@825B <8@"

When correctly compressed externally, these strings can be decompressed by smaz.js. So the problem seems to be with compression only.

Also, some unicode characters are fine:

smaz.decompress(smaz.compress("öäü"))
"öäü"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.