crc32-stream
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -17,2 +17,4 @@ /** | ||
this.checksum.writeInt32BE(0, 0); | ||
this.rawSize = 0; | ||
} | ||
@@ -25,2 +27,3 @@ | ||
this.checksum = crc32(chunk, this.checksum); | ||
this.rawSize += chunk.length; | ||
} | ||
@@ -39,2 +42,6 @@ | ||
CRC32Stream.prototype.size = function() { | ||
return this.rawSize; | ||
}; | ||
module.exports = CRC32Stream; |
{ | ||
"name": "crc32-stream", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "a streaming CRC32 checksumer", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/ctalkington/node-crc32-stream", |
@@ -1,2 +0,2 @@ | ||
# crc32-stream v0.1.2 [![Build Status](https://travis-ci.org/ctalkington/node-crc32-stream.svg?branch=master)](https://travis-ci.org/ctalkington/node-crc32-stream) | ||
# crc32-stream v0.2.0 [![Build Status](https://travis-ci.org/ctalkington/node-crc32-stream.svg?branch=master)](https://travis-ci.org/ctalkington/node-crc32-stream) | ||
@@ -47,2 +47,6 @@ crc32-stream is a streaming CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched. | ||
#### size() | ||
Returns the raw size/length of passed-through data. | ||
### Instance Options | ||
@@ -49,0 +53,0 @@ |
@@ -19,2 +19,3 @@ /*global before,describe,it */ | ||
assert.equal(checksum.hex(), 'E81722F0'); | ||
assert.equal(checksum.size(), 16384); | ||
done(); | ||
@@ -21,0 +22,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9052
126
59