Skip to content

Commit 086103b

Browse files
calebboydrvagg
authored andcommitted
doc: show keylen in pbkdf2 as a byte length
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>
1 parent 4c80c02 commit 086103b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/crypto.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,13 @@ Example (obtaining a shared secret):
621621
## crypto.pbkdf2(password, salt, iterations, keylen[, digest], callback)
622622

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

628628
Example:
629629

630-
crypto.pbkdf2('secret', 'salt', 4096, 512, 'sha256', function(err, key) {
630+
crypto.pbkdf2('secret', 'salt', 4096, 64, 'sha256', function(err, key) {
631631
if (err)
632632
throw err;
633633
console.log(key.toString('hex')); // 'c5e478d...1469e50'

0 commit comments

Comments
 (0)