Skip to content

Commit

Permalink
doc: document that whitespace is ignored in base64 decoding
Browse files Browse the repository at this point in the history
Fixes: #8569

PR-URL: #34227
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
jasnell authored and MylesBorins committed Jul 16, 2020
1 parent 431bfe1 commit 6f014d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ string into a `Buffer` as decoding.

* `'base64'`: [Base64][] 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][].
specified in [RFC 4648, Section 5][]. Whitespace characters such as spaces,
tabs, and new lines contained within the base64-encoded string are ignored.

* `'hex'`: Encode each byte as two hexadecimal characters. Data truncation
may occur when decoding string that do exclusively contain valid hexadecimal
Expand Down

0 comments on commit 6f014d0

Please sign in to comment.