Skip to content

Commit c72223e

Browse files
committed
Doc improvements
related to #1391, #1415.
1 parent 8b3ba47 commit c72223e

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

doc/api/crypto.markdown

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ This can be called many times with new data as it is streamed.
5757
Calculates the digest of all of the passed data to be hashed.
5858
The `encoding` can be `'hex'`, `'binary'` or `'base64'`.
5959

60+
Note: `hash` object can not be used after `digest()` method been called.
61+
6062

6163
### crypto.createHmac(algorithm, key)
6264

@@ -75,6 +77,8 @@ This can be called many times with new data as it is streamed.
7577
Calculates the digest of all of the passed data to the hmac.
7678
The `encoding` can be `'hex'`, `'binary'` or `'base64'`.
7779

80+
Note: `hmac` object can not be used after `digest()` method been called.
81+
7882

7983
### crypto.createCipher(algorithm, password)
8084

@@ -106,6 +110,9 @@ Returns the enciphered contents, and can be called many times with new data as i
106110

107111
Returns any remaining enciphered contents, with `output_encoding` being one of: `'binary'`, `'base64'` or `'hex'`.
108112

113+
Note: `cipher` object can not be used after `final()` method been called.
114+
115+
109116
### crypto.createDecipher(algorithm, password)
110117

111118
Creates and returns a decipher object, with the given algorithm and key.
@@ -126,6 +133,8 @@ The `output_decoding` specifies in what format to return the deciphered plaintex
126133
Returns any remaining plaintext which is deciphered,
127134
with `output_encoding` being one of: `'binary'`, `'ascii'` or `'utf8'`.
128135

136+
Note: `decipher` object can not be used after `final()` method been called.
137+
129138

130139
### crypto.createSign(algorithm)
131140

@@ -145,6 +154,9 @@ Calculates the signature on all the updated data passed through the signer.
145154

146155
Returns the signature in `output_format` which can be `'binary'`, `'hex'` or `'base64'`.
147156

157+
Note: `signer` object can not be used after `sign()` method been called.
158+
159+
148160
### crypto.createVerify(algorithm)
149161

150162
Creates and returns a verification object, with the given algorithm.
@@ -164,3 +176,6 @@ signature for the data, in the `signature_format` which can be `'binary'`,
164176
`'hex'` or `'base64'`.
165177

166178
Returns true or false depending on the validity of the signature for the data and public key.
179+
180+
Note: `verifier` object can not be used after `verify()` method been called.
181+

doc/api/http.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ Note: that Content-Length is given in bytes not characters. The above example
283283
works because the string `'hello world'` contains only single byte characters.
284284
If the body contains higher coded characters then `Buffer.byteLength()`
285285
should be used to determine the number of bytes in a given encoding.
286+
And Node does not check whether Content-Length and the length of the body
287+
which has been transmitted are equal or not.
286288

287289
### response.statusCode
288290

@@ -589,6 +591,8 @@ event, the entire body will be caught.
589591
});
590592

591593
This is a `Writable Stream`.
594+
Note: Node does not check whether Content-Length and the length of the body
595+
which has been transmitted are equal or not.
592596

593597
This is an `EventEmitter` with the following events:
594598

0 commit comments

Comments
 (0)