{"_id":"@confuzzle/move-to-front","_rev":"1-f8f4d4c2dbd560c04a2364e49aef3615","name":"@confuzzle/move-to-front","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@confuzzle/move-to-front","version":"1.0.0","description":"naive Move-to-front transform","license":"MIT","repository":{"type":"git","url":"git+https://github.com/rjkat/confuzzle.git"},"main":"mtf.js","keywords":["move-to-front","transform","mtf","compression"],"dependencies":{},"bugs":{"url":"https://github.com/rjkat/confuzzle/issues"},"homepage":"https://github.com/rjkat/confuzzle#readme","_id":"@confuzzle/move-to-front@1.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-BD4i5YaIFatlHlETbxTN00R0FuXk16yYjXEDuCqHUDeWprwds/EaLV9FUpPQKDt3Vo2GRthZtlgdJgAILQZI+g==","shasum":"444a3316b5ef793f0fd6dc11a81c7900b1c53a9c","tarball":"https://registry.npmjs.org/@confuzzle/move-to-front/-/move-to-front-1.0.0.tgz","fileCount":3,"unpackedSize":2412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFoqXCRA9TVsSAnZWagAAklwP/3/mo7NloVyS38GLNtBn\nUlokLA1f2Ys0vCcSiGMbr44B6VlVXet3DM3reBO6BSPJ3UDuZ8o6ZqmyqoO3\nS1qvZe6PS405yfRzOTGOS6hovHUKWO1uBZkHZ3qDHlUCTXHyX9s/oFPRcAAe\ndZPntE9h0mk+PG315WkQqXGGKxSGfYt/uXiK71Cfsl3tDUf4e5JK2VeM8OCd\nUVUpOkT0AEBqElH0Je8g1XJYonReDFw6wb6L0hcODpYpOmEnRa5Q6hw09314\nzdWjsbikxqeGi8wPqbdT8YDYEZAG1ogRIRqIUH2aQyV5zCtbM+FDOWTs0bhP\nkFUrQ/sTFkYzdg6BB63SnpcfPEYh33O6xCMeqS4F4Y14nh600aukjrU9TzK3\npV2Ova0LH1BdOX5aFoijDiWdx4FXH8yy5NmVWmwlwxiXmCUHWPfm52MEGDqM\nNR1KAC2QGv1/vwXvECSckWIknaAENsUufQeQSOO0mP/9kVRdMURI8rbh3ZTn\nE5Q7iD54/WSb+C3zVOA3xE7xv0e0G2TY93nH7ZNrO9iH8ppXXaQouOdoAKZS\nG1VLarYsF+Qct9GraSJK9YIxaLsI54ldrZPwnXL4LrNRx5EKuAUlgdTTyIQz\nkNxxJYEFD7DvgR4+2Syh81gWVY3CZH40pgNidE9pbsswcF2U6+8rQE4lBs1C\nw1mh\r\n=dj9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBch0cGO5R5KTf0+E5x9Fg8KlK9wcXH0NAUjknoFuLmwAiEA8URERXPrmq6r9IJ8xs2ViH7ACb6OXxBCVqEF1GpxHj4="}]},"_npmUser":{"name":"rjkat","email":"rjkat@ieee.org"},"directories":{},"maintainers":[{"name":"rjkat","email":"rjkat@ieee.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-to-front_1.0.0_1612090006921_0.17201327202949468"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-31T10:46:46.672Z","1.0.0":"2021-01-31T10:46:47.058Z","modified":"2022-04-05T00:54:29.182Z"},"maintainers":[{"name":"rjkat","email":"rjkat@ieee.org"}],"description":"naive Move-to-front transform","homepage":"https://github.com/rjkat/confuzzle#readme","keywords":["move-to-front","transform","mtf","compression"],"repository":{"type":"git","url":"git+https://github.com/rjkat/confuzzle.git"},"bugs":{"url":"https://github.com/rjkat/confuzzle/issues"},"license":"MIT","readme":"# @confuzzle/move-to-front\n\nThis package contains a naive, inefficient implementation of the [Move-to-front transform](https://en.wikipedia.org/wiki/Move-to-front_transform).\n\nFor details of how this can be used together with the\n[Burrows-Wheeler transform](https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform)\nto improve compression, see [this excellent blog post by Tommy Reddad](https://reddad.ca/2019/08/08/burrows-wheeler/).\n\n## See also\n\n- [@confuzzle/burrows-wheeler](https://www.npmjs.com/package/@confuzzle/burrows-wheeler) - naive Burrows-Wheeler transform implementation\n- [@thi.ng/range-coder](https://www.npmjs.com/package/@thi.ng/range-coder) - useful for compressing the transformed result\n\n## Functionality\n\nThis package provides two functions:\n   - `forward(s)`, which runs `Buffer.from(s)` and performs the forward transform on the result\n   - `inverse(x)`, which runs `Buffer.from(x)` performs the inverse transform on the result\nBoth functions return a `Buffer` object.\n\n## Example Usage\n\n```js\nconst mtf = require('@confuzzle/move-to-front');\nconst s = 'abracadabra';\nconst t = mtf.forward(s);\nconst inv = mtf.inverse(t).toString();\nconsole.log(inv) // abracadabra\n```","readmeFilename":"README.md"}