docs: document 'encoding' arg of hash.update()
authorDave Irvine <davman99@gmail.com>
Thu, 22 Dec 2011 14:39:53 +0000 (14:39 +0000)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 22 Dec 2011 15:57:07 +0000 (16:57 +0100)
doc/api/crypto.markdown

index d51b1fa..6ca68d5 100644 (file)
@@ -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
+    }