Skip to content

Commit

Permalink
doc: document base64url encoding support
Browse files Browse the repository at this point in the history
Documents that creating a buffer from base64 encoded string
transparently supports "URL and Filename Safe Alphabet" base64url
encoding.

PR-URL: #5243
Reviewed-By: Ben Noorhduis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
Reviewed-By: Alejandro Oviedo <alejandro.oviedo.g@gmail.com>
  • Loading branch information
tristanls authored and silverwind committed Feb 27, 2016
1 parent c6ae7d0 commit 1411e0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ The character encodings currently supported by Node.js include:

* `'ucs2'` - Alias of `'utf16le'`.

* `'base64'` - Base64 string encoding.
* `'base64'` - Base64 string encoding. When creating a buffer from a string,
this encoding will also correctly accept "URL and Filename Safe Alphabet" as
specified in [RFC 4648, Section 5].

* `'binary'` - A way of encoding the buffer into a one-byte (`latin-1`)
encoded string. The string `'latin-1'` is not supported. Instead, pass
Expand Down Expand Up @@ -1379,3 +1381,4 @@ has observed undue memory retention in their applications.
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
[`util.inspect()`]: util.html#util_util_inspect_object_options
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
[RFC 4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5

0 comments on commit 1411e0b

Please sign in to comment.