[Pkg-javascript-commits] [node-sha.js] 93/237: use fakebuffer instead of buffer
Bastien Roucariès
rouca at moszumanska.debian.org
Fri May 5 09:03:39 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 a6398fe0582e88aa837a6058494ff7a9c783bd23
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date: Sun Jan 12 00:03:31 2014 +0700
use fakebuffer instead of buffer
---
hash.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hash.js b/hash.js
index e42e81b..c14f704 100644
--- a/hash.js
+++ b/hash.js
@@ -1,6 +1,7 @@
var u = require('./util')
var write = u.write
var fill = u.zeroFill
+var Buffer = require('./fakebuffer')
var toBuffer = require('bops/typedarray/from')
module.exports = Hash
@@ -44,7 +45,7 @@ Hash.prototype.update = function (data, enc) {
length = lengthOf(data, enc)
} else
length = data.byteLength || data.length
-
+
var l = this._len += length
var s = this._s = (this._s || 0)
var f = 0
@@ -76,11 +77,9 @@ Hash.prototype.digest = function (enc) {
var bits = len % (bl*8)
//add end marker, so that appending 0's creats a different hash.
- //console.log('--- final ---', bits, fl, this._len % bl, fl + 4, fl*8, bits >= fl*8)
- //console.log(hexpp(x))
x[this._len % bl] = 0x80
fill(this._block, this._len % bl + 1)
-
+
if(bits >= fl*8) {
this._update(this._block)
u.zeroFill(this._block, 0)
--
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