[Pkg-javascript-commits] [node-sha.js] 03/31: Add test for large data

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 30 11:23:25 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 e9636950b88c8e2a0b012c19f4957229d409b04f
Author: Andrey Semerun <andrey.semerun at gmail.com>
Date:   Thu Nov 10 02:54:35 2016 +0200

    Add test for large data
---
 test/test.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/test/test.js b/test/test.js
index 0a46e44..9f93ee6 100644
--- a/test/test.js
+++ b/test/test.js
@@ -83,3 +83,18 @@ tape('hex encoding', function (t) {
 
   t.end()
 })
+
+tape('call digest for more than MAX_UINT32 bits of data', function (t) {
+  var _hash = crypto.createHash('sha1')
+  var hash = new Sha1()
+  var bigData = new Buffer(Math.pow(2, 32) / 8)
+
+  hash.update(bigData)
+  _hash.update(bigData)
+
+  var a = hash.digest('hex')
+  var e = _hash.digest('hex')
+
+  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