2018-06-13 22:39:39 +03:00
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2018-06-19 09:12:57 +03:00
|
|
|
var crypto_1 = require("crypto");
|
2018-06-17 23:47:28 +03:00
|
|
|
var bytes_1 = require("./bytes");
|
2018-06-19 09:12:57 +03:00
|
|
|
function bufferify(value) {
|
|
|
|
return new Buffer(bytes_1.arrayify(value));
|
|
|
|
}
|
|
|
|
function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
|
|
|
return bytes_1.arrayify(crypto_1.pbkdf2Sync(bufferify(password), bufferify(salt), iterations, keylen, hashAlgorithm));
|
2018-06-13 22:39:39 +03:00
|
|
|
}
|
|
|
|
exports.pbkdf2 = pbkdf2;
|