[Pkg-javascript-commits] [node-hash-base] 07/13: Reset state after HashBase#_digest

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 12 22:00:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch upstream
in repository node-hash-base.

commit 1a4298c9401597c5e632b29a653ca88d965ae2b2
Author: Kirill Fomichev <fanatid at ya.ru>
Date:   Tue Nov 1 11:36:57 2016 +0300

    Reset state after HashBase#_digest
---
 index.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/index.js b/index.js
index e455590..50d526f 100644
--- a/index.js
+++ b/index.js
@@ -78,6 +78,12 @@ HashBase.prototype.digest = function (encoding) {
 
   var digest = this._digest()
   if (encoding !== undefined) digest = digest.toString(encoding)
+
+  // reset state
+  this._block.fill(0)
+  this._blockOffset = 0
+  for (var i = 0; i < 4; ++i) this._length[i] = 0
+
   return digest
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-hash-base.git



More information about the Pkg-javascript-commits mailing list