From 74c29c9cc51a4340e8e21c9f1a927f2781b58e6b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Nov 2022 12:09:10 +0100 Subject: [PATCH] Add comment --- lib/internal/crypto/random.js | 6 ++++++ 1 file changed, 6 insertions(+) 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; /**