diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index c67170708b70c6..fe76cf1a69ef43 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -498,6 +498,12 @@ function generatePrimeSync(size, options = kEmptyObject) { return job.result(prime); } +/** + * 48 is the ASCII code for '0', 97 is the ASCII code for 'a'. + * @param {number} number An integer between 0 and 15. + * @returns {number} corresponding to the ASCII code of the hex representation + * of the parameter. + */ const numberToHexCharCode = (number) => (number < 10 ? 48 : 87) + number; /**