crc32-stream
Advanced tools
Comparing version 1.0.1 to 2.0.0
## Changelog | ||
**2.0.0** — <small>_February 13, 2017_</small> — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.1...2.0.0) | ||
- adopt nodejs core Hash API (GH #4) | ||
**1.0.1** — <small>_January 12, 2016_</small> — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.0...1.0.1) | ||
@@ -4,0 +8,0 @@ |
@@ -32,8 +32,10 @@ /** | ||
CRC32Stream.prototype.digest = function() { | ||
return this.checksum >>> 0; | ||
CRC32Stream.prototype.digest = function(encoding) { | ||
var checksum = new Buffer(4); | ||
checksum.writeUInt32BE(this.checksum >>> 0, 0); | ||
return encoding ? checksum.toString(encoding) : checksum; | ||
}; | ||
CRC32Stream.prototype.hex = function() { | ||
return this.digest().toString(16).toUpperCase(); | ||
return this.digest('hex').toUpperCase(); | ||
}; | ||
@@ -43,2 +45,2 @@ | ||
return this.rawSize; | ||
}; | ||
}; |
@@ -51,8 +51,10 @@ /** | ||
DeflateCRC32Stream.prototype.digest = function() { | ||
return this.checksum >>> 0; | ||
DeflateCRC32Stream.prototype.digest = function(encoding) { | ||
var checksum = new Buffer(4); | ||
checksum.writeUInt32BE(this.checksum >>> 0, 0); | ||
return encoding ? checksum.toString(encoding) : checksum; | ||
}; | ||
DeflateCRC32Stream.prototype.hex = function() { | ||
return this.digest().toString(16).toUpperCase(); | ||
return this.digest('hex').toUpperCase(); | ||
}; | ||
@@ -68,2 +70,2 @@ | ||
} | ||
}; | ||
}; |
{ | ||
"name": "crc32-stream", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "a streaming CRC32 checksumer", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/archiverjs/node-crc32-stream", |
@@ -1,7 +0,5 @@ | ||
# crc32-stream v1.0.1 [![Build Status](https://travis-ci.org/archiverjs/node-crc32-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-crc32-stream) [![Build status](https://ci.appveyor.com/api/projects/status/sy60s39cmyvd60i3/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-crc32-stream/branch/master) | ||
# crc32-stream v2.0.0 [![Build Status](https://travis-ci.org/archiverjs/node-crc32-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-crc32-stream) [![Build status](https://ci.appveyor.com/api/projects/status/sy60s39cmyvd60i3/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-crc32-stream/branch/master) | ||
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. | ||
[![NPM](https://nodei.co/npm/crc32-stream.png)](https://nodei.co/npm/crc32-stream/) | ||
### Install | ||
@@ -8,0 +6,0 @@ |
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
8237
99
79