Comparing version
@@ -41,4 +41,12 @@ // Generated by CoffeeScript 1.7.1 | ||
CRC.prototype.checksum = function() { | ||
return this.crc ^ this.XOR_MASK; | ||
CRC.prototype.checksum = function(signed) { | ||
var sum; | ||
if (signed == null) { | ||
signed = true; | ||
} | ||
sum = this.crc ^ this.XOR_MASK; | ||
if (signed) { | ||
sum = sum >>> 0; | ||
} | ||
return sum; | ||
}; | ||
@@ -45,0 +53,0 @@ |
@@ -26,3 +26,3 @@ // Generated by CoffeeScript 1.7.1 | ||
_Class.prototype.pack = function(crc) { | ||
return hex((crc & 0xff000000) >> 24) + hex((crc & 0xff0000) >> 16) + hex((crc & 0xff00) >> 8) + hex(crc & 0xff); | ||
return hex(crc >> 24 & 0xff) + hex(crc >> 16 & 0xff) + hex(crc >> 8 & 0xff) + hex(crc & 0xff); | ||
}; | ||
@@ -33,3 +33,3 @@ | ||
return function(b) { | ||
return _this.crc = ((_this.crc >> 8) & 0x00ffffff) ^ _this.TABLE[(_this.crc ^ b) & 0xff]; | ||
return _this.crc = _this.TABLE[(_this.crc ^ b) & 0xff] ^ (_this.crc >>> 8); | ||
}; | ||
@@ -36,0 +36,0 @@ })(this)); |
{ | ||
"name": "crc", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "CRC JavaScript implementation", | ||
@@ -10,4 +10,4 @@ "keywords": [ | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha test/*.spec.coffee", | ||
"pretest": "./node_modules/.bin/coffee --bare --output ./lib --compile ./src/*.coffee" | ||
"test": "mocha test/*.spec.coffee", | ||
"pretest": "coffee --bare --output ./lib --compile ./src/*.coffee" | ||
}, | ||
@@ -14,0 +14,0 @@ "author": { |
# crc | ||
[](http://badge.fury.io/js/crc) | ||
[](https://david-dm.org/alexgorbatchev/crc) | ||
[](https://david-dm.org/alexgorbatchev/crc#info=devDependencies) | ||
[](https://travis-ci.org/alexgorbatchev/crc) | ||
[](http://badge.fury.io/js/crc) | ||
[](https://david-dm.org/alexgorbatchev/node-crc) | ||
[](https://david-dm.org/alexgorbatchev/node-crc#info=devDependencies) | ||
[](https://travis-ci.org/alexgorbatchev/node-crc) | ||
[](https://www.gittip.com/alexgorbatchev/) | ||
[](https://npmjs.org/package/crc) | ||
[](https://npmjs.org/package/crc) | ||
@@ -33,3 +34,3 @@ Module for calculating Cyclic Redundancy Check (CRC). | ||
$ npm install | ||
$ make test | ||
$ npm test | ||
@@ -36,0 +37,0 @@ ## Usage Example |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
110
0.92%56401
-51.96%38
-55.29%353
-78.84%