From 045bfe0da566d8c0b2ce998dbb38055ab783391c Mon Sep 17 00:00:00 2001 From: Dave Irvine Date: Thu, 22 Dec 2011 14:39:53 +0000 Subject: [PATCH] docs: document 'encoding' arg of hash.update() --- doc/api/crypto.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index d51b1fa0c0..6ca68d5c38 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -47,9 +47,10 @@ Example: this program that takes the sha1 sum of a file console.log(d + ' ' + filename); }); -### hash.update(data) +### hash.update(data, input_encoding='binary') -Updates the hash content with the given `data`. +Updates the hash content with the given `data`, the encoding of which is given +in `input_encoding` and can be `'utf8'`, `'ascii'` or `'binary'`. This can be called many times with new data as it is streamed. ### hash.digest(encoding='binary') @@ -255,4 +256,4 @@ Generates cryptographically strong pseudo-random data. Usage: console.log('Have %d bytes of random data: %s', buf.length, buf); } catch (ex) { // handle error - } \ No newline at end of file + }