From d771d5efceee93a06d01a513826553547c75c68e Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 20 Jul 2016 01:06:10 +0200 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/7799 Reviewed-By: Claudio Rodriguez Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- doc/api/crypto.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 43e6167d2ef520..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 `'utf8'` 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 `'utf8'` 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 `'utf8'` 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. @@ -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.