From: Brian White Date: Tue, 1 Mar 2016 02:03:14 +0000 (-0500) Subject: doc: fix crypto update() signatures X-Git-Tag: v4.4.2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6ec8a6cb7e07dc3638c03c1ded3195fc99f8467;p=platform%2Fupstream%2Fnodejs.git doc: fix crypto update() signatures PR-URL: https://github.com/nodejs/node/pull/5500 Reviewed-By: Shigeki Ohtsu --- diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index de51bb6..22f4f54 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -669,10 +669,15 @@ provided a string is returned; otherwise a [`Buffer`][] is returned; The `Hmac` object can not be used again after `hmac.digest()` has been called. Multiple calls to `hmac.digest()` will result in an error being thrown. -### hmac.update(data) +### hmac.update(data[, input_encoding]) -Update the `Hmac` content with the given `data`. This can be called -many times with new data as it is streamed. +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 +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. ## Class: Sign @@ -733,10 +738,15 @@ returned. The `Sign` object can not be again used after `sign.sign()` method has been called. Multiple calls to `sign.sign()` will result in an error being thrown. -### sign.update(data) +### sign.update(data[, input_encoding]) -Updates the sign object with the given `data`. This can be called many times -with new data as it is streamed. +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 +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. ## Class: Verify @@ -780,10 +790,15 @@ console.log(verify.verify(public_key, signature)); // Prints true or false ``` -### verifier.update(data) +### verifier.update(data[, input_encoding]) -Updates the verifier object with the given `data`. This can be called many -times with new data as it is streamed. +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 +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. ### verifier.verify(object, signature[, signature_format])