chore(hash) cr-lf -> lf

This commit is contained in:
coderaiser 2013-11-19 08:23:12 +00:00
parent 1a6a1ca3b5
commit fa2e947a9c

View file

@ -1,39 +1,39 @@
(function (object) {
'use strict';
var util = require('util'),
Writable = require('stream').Writable;
util.inherits(HashProto, Writable);
object.Hash = new HashProto();
function HashProto() {
var shasum,
crypto = require('crypto');
Writable.call(this);
this.create = function() {
var ws = new Writable();
ws._write = write;
ws.get = get;
shasum = crypto.createHash('sha1');
return ws;
};
function get() {
var hex = shasum.digest('hex');
return hex;
}
function write (chunk, enc, next) {
shasum.update(chunk);
next();
}
}
})(this);
(function (object) {
'use strict';
var util = require('util'),
Writable = require('stream').Writable;
util.inherits(HashProto, Writable);
object.Hash = new HashProto();
function HashProto() {
var shasum,
crypto = require('crypto');
Writable.call(this);
this.create = function() {
var ws = new Writable();
ws._write = write;
ws.get = get;
shasum = crypto.createHash('sha1');
return ws;
};
function get() {
var hex = shasum.digest('hex');
return hex;
}
function write (chunk, enc, next) {
shasum.update(chunk);
next();
}
}
})(this);