summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-10-11 08:32:36 -0700
committerisaacs <i@izs.me>2012-10-11 08:32:46 -0700
commit99b2368a6cd408e75850ac73585de8800e2a10a1 (patch)
treefa2e53cbfc30f988d97fa368a4d062e745f14518 /doc
parent6a128e037e5b9f0c5c84fc24d343db3364a56d64 (diff)
downloadnodejs-99b2368a6cd408e75850ac73585de8800e2a10a1.tar.gz
nodejs-99b2368a6cd408e75850ac73585de8800e2a10a1.tar.bz2
nodejs-99b2368a6cd408e75850ac73585de8800e2a10a1.zip
doc: Reduce crypto stability to 2-Unstable
Diffstat (limited to 'doc')
-rw-r--r--doc/api/crypto.markdown34
1 files changed, 33 insertions, 1 deletions
diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown
index 87b9ac378..87da3a78d 100644
--- a/doc/api/crypto.markdown
+++ b/doc/api/crypto.markdown
@@ -1,6 +1,7 @@
# Crypto
- Stability: 3 - Stable
+ Stability: 2 - Unstable; API changes are being discussed for
+ future versions. Breaking changes will be minimized. See below.
Use `require('crypto')` to access this module.
@@ -366,6 +367,37 @@ Generates cryptographically strong pseudo-random data. Usage:
// handle error
}
+## Proposed API Changes in Future Versions of Node
+
+The Crypto module was added to Node before there was the concept of a
+unified Stream API, and before there were Buffer objects for handling
+binary data.
+
+As such, the streaming classes don't have the typical methods found on
+other Node classes, and many methods accept and return Binary-encoded
+strings by default rather than Buffers.
+
+A future version of node will make Buffers the default data type.
+This will be a breaking change for some use cases, but not all.
+
+For example, if you currently use the default arguments to the Sign
+class, and then pass the results to the Verify class, without ever
+inspecting the data, then it will continue to work as before. Where
+you now get a binary string and then present the binary string to the
+Verify object, you'll get a Buffer, and present the Buffer to the
+Verify object.
+
+However, if you are doing things with the string data that will not
+work properly on Buffers (such as, concatenating them, storing in
+databases, etc.), or you are passing binary strings to the crypto
+functions without an encoding arguemnt, then you will need to start
+providing encoding arguments to specify which encoding you'd like to
+use.
+
+Also, a Streaming API will be provided, but this will be done in such
+a way as to preserve the legacy API surface.
+
+
[createCipher()]: #crypto_crypto_createcipher_algorithm_password
[createCipheriv()]: #crypto_crypto_createcipheriv_algorithm_key_iv
[crypto.createDiffieHellman()]: #crypto_crypto_creatediffiehellman_prime_encoding