mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
docs: document 'encoding' arg of hash.update()
This commit is contained in:
committed by
Ben Noordhuis
parent
d8c178bc16
commit
045bfe0da5
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user