Skip to content

doc,crypto: cleanup removed pbkdf2 behaviours

Refs https://nodejs.org/api/deprecations.html#DEP0009, #11305, #31166.

> crypto.pbkdf2('f', 'f', 1, 20, null, console.log)
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "digest" argument must be of type string. Received null
    at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:121:11)
    at check (node:internal/crypto/pbkdf2:90:3)
    at Object.pbkdf2 (node:internal/crypto/pbkdf2:43:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
> crypto.pbkdf2('f', 'f', 1, 20, undefined, console.log)
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "digest" argument must be of type string. Received undefined
    at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:121:11)
    at check (node:internal/crypto/pbkdf2:90:3)
    at Object.pbkdf2 (node:internal/crypto/pbkdf2:43:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Merge request reports

Loading