Skip to content

Commit 1411e0b

Browse files
tristanlssilverwind
authored andcommitted
doc: document base64url encoding support
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 <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Alejandro Oviedo <[email protected]>
1 parent c6ae7d0 commit 1411e0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/api/buffer.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ The character encodings currently supported by Node.js include:
6262

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

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

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

0 commit comments

Comments
 (0)