@confuzzle/burrows-wheeler

1.0.0 • Public • Published

@confuzzle/burrows-wheeler

This package contains a naive, inefficient implementation of the Burrows-Wheeler transform, which only works for input sizes of less than 64KiB.

For details for how this can be used together with the Move-to-front transform to improve compression, see this excellent blog post by Tommy Reddad. Another resource that may be useful is this previous assignment set for the COS226 course at Princeton in 2003.

See also

Functionality

This package provides two functions:

  • forward(s), which runs Buffer.from(s) and performs the forward transform on the result
  • inverse(x), which runs Buffer.from(x) performs the inverse transform on the result Both functions return a Buffer object.

Example Usage

const bwt = require('@confuzzle/burrows-wheeler');
const s = 'abracadabra';
const t = bwt.forward(s);
const inv = bwt.inverse(t).toString();
console.log(inv) // abracadabra

Package Sidebar

Install

npm i @confuzzle/burrows-wheeler

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.07 kB

Total Files

3

Last publish

Collaborators

  • rjkat