package
Native node addon to calculate CRC16 values.
npm install crc16GitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
184.7 kB
Includes dependencies.
Native node addon to calculate CRC16 values.
npm i crc16 --saveIf your intention is to use this to calculate redis slots then please use https://github.com/Salakar/cluster-key-slot - it's a pure JS implementation I wrote that is much faster than doing it natively.
CRC16(stringOrBuffer, [optional] encoding)stringOrBuffervar CRC16 = require('crc16');
console.log(CRC16('some_value'));
console.log(CRC16('0d0103588990501766460026', 'hex'));
// calculate a redis hash slot
console.log(CRC16('key') & 16383);APACHE-2.0