From 4be432862ae5fc48dfd3814b1af389a4c2dfc390 Mon Sep 17 00:00:00 2001 From: calebboyd Date: Mon, 19 Oct 2015 12:38:55 -0500 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/3334 Reviewed-By: Fedor Indutny Reviewed-By: Jeremiah Senkpiel --- doc/api/crypto.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index 0379179de3593c..04d7af6a168334 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -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'