Skip to content

Commit 61056c0

Browse files
Forbes Lindesaycalvinmetcalf
authored andcommitted
Modularize pbkdf2-compat
1 parent 304318d commit 61056c0

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports.getHashes = function () {
1111
return hashes;
1212
}
1313

14-
var p = require('./pbkdf2')(exports)
14+
var p = require('pbkdf2-compat')
1515
exports.pbkdf2 = p.pbkdf2
1616
exports.pbkdf2Sync = p.pbkdf2Sync
1717

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"create-hmac": "^1.1.0",
2424
"diffie-hellman": "^3.0.1",
2525
"inherits": "^2.0.1",
26-
"pbkdf2-compat": "2.0.1",
26+
"pbkdf2-compat": "^3.0.1",
2727
"public-encrypt": "1.1.2",
2828
"randombytes": "^2.0.0"
2929
},

pbkdf2.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/pbkdf2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
var tape = require('tape')
3-
var pbkdf2Sync = require('../').pbkdf2Sync
3+
var crypto = require('pbkdf2-compat/browser')
44

55
var vectors = require('hash-test-vectors/pbkdf2')
66

@@ -9,7 +9,7 @@ tape('pbkdf2', function (t) {
99
//skip inputs that will take way too long
1010
if(input.iterations > 10000) return
1111

12-
var key = pbkdf2Sync(input.password, input.salt, input.iterations, input.length)
12+
var key = crypto.pbkdf2Sync(input.password, input.salt, input.iterations, input.length)
1313

1414
if(key.toString('hex') !== input.sha1)
1515
console.log(input)

0 commit comments

Comments
 (0)