diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 0af112727b3f65..a40178db22e6ab 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -544,7 +544,7 @@ const aliceSecret = alice.computeSecret(bobKey); const bobSecret = bob.computeSecret(aliceKey); assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - // OK +// OK ``` ### ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding]) @@ -684,10 +684,11 @@ const hash = crypto.createHash('sha256'); hash.on('readable', () => { const data = hash.read(); - if (data) + if (data) { console.log(data.toString('hex')); // Prints: // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + } }); hash.write('some data to hash'); @@ -767,10 +768,11 @@ const hmac = crypto.createHmac('sha256', 'a secret'); hmac.on('readable', () => { const data = hmac.read(); - if (data) + if (data) { console.log(data.toString('hex')); // Prints: // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + } }); hmac.write('some data to hash'); diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 3a10604020db90..f1f48fadd5fc29 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -71,7 +71,7 @@ in the following example: // Assuming gbkDecodeURIComponent function already exists... querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - { decodeURIComponent: gbkDecodeURIComponent }); + { decodeURIComponent: gbkDecodeURIComponent }); ``` ## querystring.stringify(obj[, sep[, eq[, options]]]) @@ -115,7 +115,7 @@ following example: // Assuming gbkEncodeURIComponent function already exists, querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - { encodeURIComponent: gbkEncodeURIComponent }); + { encodeURIComponent: gbkEncodeURIComponent }); ``` ## querystring.unescape(str) diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index fbb1d55309a44b..64181586b539c4 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -25,13 +25,13 @@ Let's analyze this basic test from the Node.js test suite: ```javascript 'use strict'; // 1 const common = require('../common'); // 2 - // 3 + // This test ensures that the http-parser can handle UTF-8 characters // 4 // in the http header. // 5 - // 6 + const assert = require('assert'); // 7 const http = require('http'); // 8 - // 9 + const server = http.createServer(common.mustCall((req, res) => { // 10 res.end('ok'); // 11 })); // 12