Skip to content

Commit e963695

Browse files
sam-kamerersuperquadratic
authored andcommitted
Add test for large data
1 parent c233442 commit e963695

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,18 @@ tape('hex encoding', function (t) {
8383

8484
t.end()
8585
})
86+
87+
tape('call digest for more than MAX_UINT32 bits of data', function (t) {
88+
var _hash = crypto.createHash('sha1')
89+
var hash = new Sha1()
90+
var bigData = new Buffer(Math.pow(2, 32) / 8)
91+
92+
hash.update(bigData)
93+
_hash.update(bigData)
94+
95+
var a = hash.digest('hex')
96+
var e = _hash.digest('hex')
97+
98+
t.equal(a, e)
99+
t.end()
100+
})

0 commit comments

Comments
 (0)