index.js 330 B

123456789
  1. var crypto = require('crypto')
  2. /* istanbul ignore next */
  3. if (crypto && crypto.pbkdf2Sync && crypto.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) {
  4. exports.pbkdf2 = require('./lib/async')
  5. exports.pbkdf2Sync = require('./lib/sync')
  6. } else {
  7. exports.pbkdf2Sync = crypto.pbkdf2Sync
  8. exports.pbkdf2 = crypto.pbkdf2
  9. }