JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q37568F
  • License MIT

An ECMAScript implementation of the 8b10b line codec.

Package Exports

  • 8b10b

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (8b10b) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

8b10b

An ECMAScript implementation of the 8b10b line codec.

Use it to convert bytes to 10-bit symbols and vise-versa. It only converts to and from data symbols; control symbols should be intercepted and handled by your application.

Installation

npm install --save 8b10b

Usage

const { Encoder, Decoder } = require('8b10b');

const encoder = new Encoder(),
      decoder = new Decoder();      

const encoded = encoder.encode(42);

// => 345

decoder.decode(encoded);

// => 42

Testing

Tests use Mocha w/ Chai. To run, use npm run test.

License

See LICENSE.txt

Thanks

Most of the encoder was converted to JavaScript from fontesrp/encoding_8b10b.