Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crc16-itu

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crc16-itu - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "crc16-itu",
"version": "1.0.2",
"version": "1.0.3",
"description": "Native node addon to calculate CRC16 values.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,35 +0,26 @@

# CRC16
crc-itu
=======
Its a fork of crc-itu(https://raw.githubusercontent.com/damphat/crc-itu/) compatible with newer versions of node.
![Downloads](https://img.shields.io/npm/dt/crc16.svg)
![npm version](https://img.shields.io/npm/v/crc16.svg)
![node version](https://img.shields.io/node/v/crc16.svg)
![dependencies](https://img.shields.io/david/salakar/crc16.svg)
![dev dependencies](https://img.shields.io/david/dev/salakar/crc16.svg)
![License](https://img.shields.io/npm/l/crc16.svg)
Requirement:
- Compiler: g++ 4.8 or later
Native node addon to calculate CRC16 values.
Install:
## Installation
```
npm i crc16 --save
npm install crc-itu
```
## Usage
Usage:
##### `CRC16(stringOrBuffer, [optional] encoding)`
```
var crc16 = require('crc-itu').crc16;
- **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`
// with string and encoding
var ret = crc16('0d0103588990501766460026', 'hex');
console.log(ret.toString(16)); // 7bf9
```javascript
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
// with buffer
var buff = new Buffer('0d0103588990501766460026', 'hex');
var ret = crc16(buff);
console.log(ret.toString(16)); // 7bf9
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc