1.0.2 • Published 3 years ago

huffman-url-compressor v1.0.2

Weekly downloads
45
License
ISC
Repository
github
Last release
3 years ago

Huffman-URL-Compressor-for-Nodejs

Author: Mariano L. Acosta

Description

Convert any kind of String into a url-friendly parameter using Huffman Encoding.

Installation

    npm install --save huffman-url-compressor

Usage

Parameters:

  • Train (string): Training set that is used to create the encoder. This is where the algorithm gets the frequency for each char.
  • Test (string): String that you want to encode.

Example:

    import {createEncoder, encodeConfig, decodeConfig} from 'huffman-url-compressor';

    //create encoder

    let Encoder = createEncoder(train);

    //create a base64 encoded stream

    let encodedParam = encodeConfig(test,Encoder)
    
    //retrieve the original param 

    let decodParam= decodeConfig(encodedParam,Encoder)
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago