[Pkg-javascript-commits] [node-sha.js] 24/237: the working buffer can use system default endianness

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 3da27472f74929d223c9ca47c59c219748989981
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Fri Dec 27 08:54:27 2013 +0700

    the working buffer can use system default endianness
---
 index.js | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/index.js b/index.js
index 24c324a..bdcd11c 100644
--- a/index.js
+++ b/index.js
@@ -78,18 +78,10 @@ Sha.prototype._update = function (array) {
   for(var j = 0; j < 80; j++)
   {
     if(j < 16)
-      W.setUint32(j*4, X.getUint32((i + j)*4, BE), LE)
+      w[j] = X.getUint32((i + j)*4, BE)
     else
-      W.setUint32(
-        j*4,
-        rol(
-          W.getUint32((j -  3)*4, LE)
-        ^ W.getUint32((j -  8)*4, LE)
-        ^ W.getUint32((j - 14)*4, LE)
-        ^ W.getUint32((j - 16)*4, LE),
-        1),
-        true
-      )
+      w[j] = rol(w[j - 3] ^ w[j -  8] ^ w[j - 14] ^ w[j - 16], 1)
+        
 
     var t =
       safe_add(
@@ -98,7 +90,7 @@ Sha.prototype._update = function (array) {
           sha1_ft(j, b, c, d)
         ),
         safe_add(
-          safe_add(e, W.getUint32(j*4, LE)),
+          safe_add(e, w[j]),
           sha1_kt(j)
         )
       );

-- 
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