aboutsummaryrefslogtreecommitdiff
path: root/node_modules/crc32-stream/lib/crc32-stream.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/crc32-stream/lib/crc32-stream.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/crc32-stream/lib/crc32-stream.js')
-rw-r--r--node_modules/crc32-stream/lib/crc32-stream.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/node_modules/crc32-stream/lib/crc32-stream.js b/node_modules/crc32-stream/lib/crc32-stream.js
deleted file mode 100644
index f0b0ee6c7..000000000
--- a/node_modules/crc32-stream/lib/crc32-stream.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * node-crc32-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT
- */
-var inherits = require('util').inherits;
-var Transform = require('readable-stream').Transform;
-
-var crc32 = require('crc').crc32;
-
-var CRC32Stream = module.exports = function CRC32Stream(options) {
- Transform.call(this, options);
- this.checksum = new Buffer(4);
- this.checksum.writeInt32BE(0, 0);
-
- this.rawSize = 0;
-};
-
-inherits(CRC32Stream, Transform);
-
-CRC32Stream.prototype._transform = function(chunk, encoding, callback) {
- if (chunk) {
- this.checksum = crc32(chunk, this.checksum);
- this.rawSize += chunk.length;
- }
-
- callback(null, chunk);
-};
-
-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('hex').toUpperCase();
-};
-
-CRC32Stream.prototype.size = function() {
- return this.rawSize;
-};