crc16

Native node addon to calculate CRC16 values.


Keywords
crc16, serial, native, addon, redis
License
Apache-2.0
Install
npm install crc16@1.0.1

Documentation

CRC16

Downloads npm version node version dependencies dev dependencies License

Native node addon to calculate CRC16 values.

Installation

npm i crc16 --save

Usage

CRC16(stringOrBuffer, [optional] encoding)
  • stringOrBuffer: String or a buffer. If a string is provided it will automatically be converted to a buffer.
  • encoding: Used for string to buffer conversion - only when a string is provided in stringOrBuffer
var CRC16 = require('crc16');
console.log(CRC16('some_value'));
console.log(CRC16('0d0103588990501766460026', 'hex'));

// calculate a redis hash slot
console.log(CRC16('key') & 16383);

License

MIT