Skip to content

Commit

Permalink
doc: show keylen in pbkdf2 as a byte length
Browse files Browse the repository at this point in the history
Ensure that keylen for pbkdf2 is documented as a length of bytes and not
bits.

PR-URL: #3334
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information
calebboyd authored and rvagg committed Oct 21, 2015
1 parent 4c80c02 commit 086103b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,13 @@ Example (obtaining a shared secret):
## crypto.pbkdf2(password, salt, iterations, keylen[, digest], callback)

Asynchronous PBKDF2 function. Applies the selected HMAC digest function
(default: SHA1) to derive a key of the requested length from the password,
(default: SHA1) to derive a key of the requested byte length from the password,
salt and number of iterations. The callback gets two arguments:
`(err, derivedKey)`.

Example:

crypto.pbkdf2('secret', 'salt', 4096, 512, 'sha256', function(err, key) {
crypto.pbkdf2('secret', 'salt', 4096, 64, 'sha256', function(err, key) {
if (err)
throw err;
console.log(key.toString('hex')); // 'c5e478d...1469e50'
Expand Down

0 comments on commit 086103b

Please sign in to comment.