Why does crypto.pbkdf2 end up generating ciphertext twice as long as keylen instead of keylen?

const crypto = require("crypto");
crypto.pbkdf2("secret", "salt", 1024, 32, "sha512", function (err, derivedKey) {
    if (err) throw err;
    console.log(derivedKey.toString("hex"));
});
//  8177086d9bc2e39580a7657fabe06e685a57b861768a36406c5744711f461e49

for example, the length of the final output above is 64, why it is not the value of keylen. What exactly is the length of keylen here?

Mar.30,2021

keylen is the byte length, 1 byte = 8 bits binary = 2 bits 16 bits. I didn't turn my head around before. Confused

Menu