[Pkg-javascript-commits] [node-sha.js] 27/237: remove logging

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:02:52 UTC 2017


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

rouca pushed a commit to branch master
in repository node-sha.js.

commit ce7d53af357062def163f895aa5386e3f6b7e605
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Fri Dec 27 10:01:55 2013 +0700

    remove logging
---
 hash.js      | 10 ++--------
 test/test.js |  7 ++-----
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/hash.js b/hash.js
index 3c93ecf..340a2c4 100644
--- a/hash.js
+++ b/hash.js
@@ -13,12 +13,6 @@ function Hash (blockSize, finalSize) {
 }
 
 Hash.prototype.update = function (data, enc) {
-  //convert to array of ints.
-  //since this is probably a string, copy it into the array,
-  //if it's over 16 words (and so, we have filled _i)
-  //then call _update(). if it's equal less, we have to wait,
-  //because this might be the last block, and so we have to wait for final()
-
   //for encoding/decoding utf8, see here:
   //https://github.com/chrisdickinson/bops/blob/master/typedarray/from.js#L36-L57
   //https://github.com/chrisdickinson/to-utf8
@@ -58,8 +52,8 @@ Hash.prototype.digest = function (enc) {
 
   //add end marker, so that appending 0's creats a different hash.
   x[this._len % bl] = 0x80
-  console.log('--- final ---', bits, fl, this._len % bl, fl + 4, fl*8, bits >= fl*8)
-  console.log(hexpp(x))
+//  console.log('--- final ---', bits, fl, this._len % bl, fl + 4, fl*8, bits >= fl*8)
+//  console.log(hexpp(x))
   
   if(bits >= fl*8) {
     this._update(this._block.buffer)
diff --git a/test/test.js b/test/test.js
index d3d4916..00b6af3 100644
--- a/test/test.js
+++ b/test/test.js
@@ -28,10 +28,9 @@ var inputs = [
 tape("hash is the same as node's crypto", function (t) {
 
   inputs.forEach(function (v) {
-    console.log('HASH', v, v[0].length)
     var a = new Sha1().update(v[0], v[1]).digest('hex')
     var e = crypto.createHash('sha1').update(v[0], v[1]).digest('hex')
-    console.log(a, e)
+    console.log(a, '==', e)
     t.equal(a, e)
   })
 
@@ -42,18 +41,16 @@ tape("hash is the same as node's crypto", function (t) {
 tape('call update multiple times', function (t) {
   var n = 1
   inputs.forEach(function (v) {
-    console.log('HASH', v, v[0].length)
     var hash = new Sha1()
     var _hash = crypto.createHash('sha1')
     for(var i = 0; i < v[0].length; i=(i+1)*2) {
       var s = v[0].substring(i, (i+1)*2)
-      console.log('UPDATE', s)
       hash.update(s, v[1])
       _hash.update(s, v[1])
     }
     var a = hash.digest('hex')
     var e = _hash.digest('hex')
-    console.log(a, e)
+    console.log(a, '==', e)
     t.equal(a, e)
   })
   t.end()

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



More information about the Pkg-javascript-commits mailing list