From f29728621b5518b65c81b1368556bd8e845f7033 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 20 Jul 2016 01:06:10 +0200 Subject: [PATCH 1/2] doc: correct crypto encoding information The default encoding for crypto methods was changed in v6.0.0, with v4.x keeping a default of `binary`. Ref: https://github.com/nodejs/node/pull/5500 Fixes: https://github.com/nodejs/node/issues/7712 --- doc/api/crypto.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 43e6167d2ef520..a4b22ad11759c9 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -674,7 +674,7 @@ called. Multiple calls to `hmac.digest()` will result in an error being thrown. Updates the `Hmac` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -765,7 +765,7 @@ called. Multiple calls to `sign.sign()` will result in an error being thrown. Updates the `Sign` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -817,7 +817,7 @@ console.log(verify.verify(public_key, signature)); Updates the `Verify` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -848,7 +848,7 @@ or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods default to [`Buffer`][] objects. The `crypto.DEFAULT_ENCODING` mechanism is provided for backwards compatibility -with legacy programs that expect `'binary'` to be the default encoding. +with legacy programs that expect `'utf8'` to be the default encoding. New applications should expect the default to be `'buffer'`. This property may become deprecated in a future Node.js release. From f6b5d74568e41469c416a2e044e44a51622a61ca Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 27 Jul 2016 13:10:30 +0200 Subject: [PATCH 2/2] [squash] s/enforced/implied/ --- doc/api/crypto.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index a4b22ad11759c9..62cf5106f959fd 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -601,7 +601,7 @@ called. Multiple calls will cause an error to be thrown. Updates the hash content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is implied. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -674,7 +674,7 @@ called. Multiple calls to `hmac.digest()` will result in an error being thrown. Updates the `Hmac` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is implied. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -765,7 +765,7 @@ called. Multiple calls to `sign.sign()` will result in an error being thrown. Updates the `Sign` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is implied. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -817,7 +817,7 @@ console.log(verify.verify(public_key, signature)); Updates the `Verify` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'binary'` is enforced. If `data` is a [`Buffer`][] then +encoding of `'binary'` is implied. If `data` is a [`Buffer`][] then `input_encoding` is ignored. This can be called many times with new data as it is streamed.