docs: document 'encoding' arg of hash.update()

This commit is contained in:
Dave Irvine
2011-12-22 14:39:53 +00:00
committed by Ben Noordhuis
parent d8c178bc16
commit 045bfe0da5

View 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
}
}