New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

wordzip

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

wordzip

This repository contains a collection of text encoding and decoding functions implemented in JavaScript. These functions can be used to transform text using various encoding techniques.

unpublished
latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Text Encoding and Decoding

This repository contains a collection of text encoding and decoding functions implemented in JavaScript. These functions can be used to transform text using various encoding techniques.

Functions

The following functions are available:

  • encodeKeys(input): Encodes the keys in the input text using a predefined dictionary. Words in the input that match a key in the dictionary are replaced with a caret symbol (^) followed by the corresponding key.

  • decodeKeys(input): Decodes the keys in the input text using a predefined dictionary. Words in the input that start with a caret symbol (^) followed by a key are replaced with the corresponding value from the dictionary.

  • encodeIt(input): Performs a series of encoding operations on the input text. It applies the Burrows-Wheeler Transform (BWT), Move-to-Front (MTF) encoding, Elias Gamma Coding (EGC), and Bijective Ternary Transformation (BTT) using the provided keys and dictionary.

  • decodeIt(input): Performs a series of decoding operations on the input code. It reverses the encoding operations applied by the encodeIt function using the provided keys and dictionary.

Usage

To use these functions in your JavaScript code, you can require the module and call the desired functions:

const { encodeKeys, decodeKeys, encodeIt, decodeIt } = require('text-encoding');

const encoded = encodeKeys('Hello, world!');
console.log(encoded); // Outputs: 'Hello, ^WRUJ^RBT^'

const decoded = decodeKeys('Hello, ^WRUJ^RBT^');
console.log(decoded); // Outputs: 'Hello, world!'

const encodedText = encodeIt('Hello, world!');
console.log(encodedText); // Outputs: encoded text

const decodedText = decodeIt(encodedText);
console.log(decodedText); // Outputs: 'Hello, world!'

FAQs

Package last updated on 26 Jun 2023

Related posts