Skip to content

Commit

Permalink
Forgot to return myself.
Browse files Browse the repository at this point in the history
  • Loading branch information
satazor committed Jul 2, 2015
1 parent 84724d0 commit 98f2c45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion spark-md5.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@
this._buff = state.buff;
this._length = state.length;
this._hash = state.hash;

return this;
};

/**
Expand Down Expand Up @@ -578,6 +580,11 @@
return this;
};

/**
* Gets the internal state of the computation.
*
* @return {Object} The state
*/
SparkMD5.ArrayBuffer.prototype.getState = function () {
var state = SparkMD5.prototype.getState.call(this);

Expand All @@ -587,11 +594,18 @@
return state;
};

/**
* Gets the internal state of the computation.
*
* @param {Object} state The state
*
* @return {SparkMD5.ArrayBuffer} The instance itself
*/
SparkMD5.ArrayBuffer.prototype.setState = function (state) {
// Convert string to buffer
state.buff = utf8Str2ArrayBuffer(state.buff, true);

SparkMD5.prototype.setState.call(this, state);
return SparkMD5.prototype.setState.call(this, state);
};

SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
Expand Down
2 changes: 1 addition & 1 deletion spark-md5.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98f2c45

Please sign in to comment.