socketioMEANseed/server/node_modules/crc/README.md
server/node_modules/crc/README.mdRaw
1# crc
2
3[](https://www.gittip.com/alexgorbatchev/)
4[](https://david-dm.org/alexgorbatchev/node-crc)
5[](https://david-dm.org/alexgorbatchev/node-crc#info=devDependencies)
6[](https://travis-ci.org/alexgorbatchev/node-crc)
7
8[](https://npmjs.org/package/node-crc)
9
10Module for calculating Cyclic Redundancy Check (CRC).
11
12## Features
13
14* Full test suite comparing values against reference `pycrc` implementation.
15* Version 3.x is 3x to 4x faster than version 2.x.
16* Pure JavaScript implementation, no dependencies.
17* Provides CRC Tables for optimized calculations.
18* Provides support for the following CRC algorithms:
19 * CRC1 `crc.crc1(…)`
20 * CRC8 `crc.crc8(…)`
21 * CRC8 1-Wire `crc.crc81wire(…)`
22 * CRC16 `crc.crc16(…)`
23 * CRC16 CCITT `crc.crc16ccitt(…)`
24 * CRC16 Modbus `crc.crc16modbus(…)`
25 * CRC24 `crc.crc24(…)`
26 * CRC32 `crc.crc32(…)`
27
28## IMPORTANT
29
30If you've used `crc` module prior to version 2.x, you might have some inconsistentcies with the current implementation because it relied on very old code and wasn't checked against reference implementation. If you upgrading from 1.x, please take special care.
31
32## Support
33
34<a href="https://blockchain.info/address/1CZyBREeHTmy8C5zVGHZHPwqBuWFmEuUCQ"><img src="bitcoin.png" width="150" align="right"/></a> Please support me on [GitTip](https://www.gittip.com/alexgorbatchev/). I've spend days developing and grooming this module and hope to spend more time. If you have bitcoin, please use the QR code or this wallet address [`1CZyBREeHTmy8C5zVGHZHPwqBuWFmEuUCQ`](https://blockchain.info/address/1CZyBREeHTmy8C5zVGHZHPwqBuWFmEuUCQ):
35
36## Installation
37
38 npm install crc
39
40## Running tests
41
42 $ npm install
43 $ npm test
44
45## Usage Example
46
47Calculate a CRC32:
48
49 var crc = require('crc');
50
51 crc.crc32('hello').toString(16);
52 # => "3610a686"
53
54Calculate a CRC32 of a file:
55
56 crc.crc32(fs.readFileSync('README.md', 'utf8')).toString(16);
57 # => "127ad531"
58
59Or using a `Buffer`:
60
61 crc.crc32(fs.readFileSync('README.md')).toString(16);
62 # => "127ad531"
63
64Incrementally calculate a CRC32:
65
66 value = crc32('one');
67 value = crc32('two', value);
68 value = crc32('three', value);
69 value.toString(16);
70 # => "09e1c092"
71
72## Thanks!
73
74[pycrc](http://www.tty1.net/pycrc/) library is which the source of all of the CRC tables.
75
76# License
77
78The MIT License (MIT)
79
80Copyright (c) 2014 Alex Gorbatchev
81
82Permission is hereby granted, free of charge, to any person obtaining a copy
83of this software and associated documentation files (the "Software"), to deal
84in the Software without restriction, including without limitation the rights
85to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
86copies of the Software, and to permit persons to whom the Software is
87furnished to do so, subject to the following conditions:
88
89The above copyright notice and this permission notice shall be included in
90all copies or substantial portions of the Software.
91
92THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
95AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
98THE SOFTWARE.