Initial commit for OpenECOMP SDN-C OA&M
[sdnc/oam.git] / dgbuilder / dgeflows / node_modules / express / node_modules / etag / node_modules / crc / README.md
1 # crc
2
3 [![GitTip](http://img.shields.io/gittip/alexgorbatchev.svg?style=flat)](https://www.gittip.com/alexgorbatchev/)
4 [![Dependency status](http://img.shields.io/david/alexgorbatchev/node-crc.svg?style=flat)](https://david-dm.org/alexgorbatchev/node-crc)
5 [![devDependency Status](http://img.shields.io/david/dev/alexgorbatchev/node-crc.svg?style=flat)](https://david-dm.org/alexgorbatchev/node-crc#info=devDependencies)
6 [![Build Status](http://img.shields.io/travis/alexgorbatchev/node-crc.svg?style=flat&branch=master)](https://travis-ci.org/alexgorbatchev/node-crc)
7
8 [![NPM](https://nodei.co/npm/crc.svg?style=flat)](https://npmjs.org/package/node-crc)
9
10 Module 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
30 If 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
47 Calculate a CRC32:
48
49     var crc = require('crc');
50
51     crc.crc32('hello').toString(16);
52     # => "3610a686"
53
54 Calculate a CRC32 of a file:
55
56     crc.crc32(fs.readFileSync('README.md', 'utf8')).toString(16);
57     # => "127ad531"
58
59 Or using a `Buffer`:
60
61     crc.crc32(fs.readFileSync('README.md')).toString(16);
62     # => "127ad531"
63
64 Incrementally 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
78 The MIT License (MIT)
79
80 Copyright (c) 2014 Alex Gorbatchev
81
82 Permission is hereby granted, free of charge, to any person obtaining a copy
83 of this software and associated documentation files (the "Software"), to deal
84 in the Software without restriction, including without limitation the rights
85 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
86 copies of the Software, and to permit persons to whom the Software is
87 furnished to do so, subject to the following conditions:
88
89 The above copyright notice and this permission notice shall be included in
90 all copies or substantial portions of the Software.
91
92 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
95 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
98 THE SOFTWARE.