projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22aa767
)
doc: Add crypto.pseudoRandomBytes, fix typo
author
Aaron Cannon
<cannona@fireantproductions.com>
Sun, 3 Mar 2013 21:11:08 +0000
(15:11 -0600)
committer
isaacs
<i@izs.me>
Sun, 3 Mar 2013 23:30:49 +0000
(15:30 -0800)
doc/api/crypto.markdown
patch
|
blob
|
history
diff --git
a/doc/api/crypto.markdown
b/doc/api/crypto.markdown
index
de574bc
..
dfbedca
100644
(file)
--- a/
doc/api/crypto.markdown
+++ b/
doc/api/crypto.markdown
@@
-183,8
+183,8
@@
Returned by `crypto.createCipher` and `crypto.createCipheriv`.
Cipher objects are [streams](stream.html) that are both readable and
writable. The written plain text data is used to produce the
Cipher objects are [streams](stream.html) that are both readable and
writable. The written plain text data is used to produce the
-encrypted data on the
the readable side. The legacy `update` and
-
`final`
methods are also supported.
+encrypted data on the
readable side. The legacy `update` and `final`
+methods are also supported.
### cipher.update(data, [input_encoding], [output_encoding])
### cipher.update(data, [input_encoding], [output_encoding])
@@
-464,6
+464,16
@@
Generates cryptographically strong pseudo-random data. Usage:
// handle error
}
// handle error
}
+## crypto.pseudoRandomBytes(size, [callback])
+
+Generates *non*-cryptographically strong pseudo-random data. The data
+returned will be unique if it is sufficiently long, but is not
+necessarily unpredictable. For this reason, the output of this
+function should never be used where unpredictability is important,
+such as in the generation of encryption keys.
+
+Usage is otherwise identical to `crypto.randomBytes`.
+
## crypto.DEFAULT_ENCODING
The default encoding to use for functions that can take either strings
## crypto.DEFAULT_ENCODING
The default encoding to use for functions that can take either strings