summaryrefslogtreecommitdiff
path: root/src/base64.h
AgeCommit message (Collapse)Author
2019-02-27src: apply clang-tidy rule modernize-deprecated-headersgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26159 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-15src: change macro to fnGino Notto
Change base64_encoded_size and unbase64 to inline functions. The base64_encoded_size is a constexpr to be used in function declarations. PR-URL: https://github.com/nodejs/node/pull/23603 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-11-27src: make base64.h self-containedDaniel Bevenius
This commit includes stdint.h (for uint8_t, uint32_t, and int8_t) to make it self-contained. PR-URL: https://github.com/nodejs/node/pull/17177 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-06-16src: fix decoding base64 with whitespaceNikolai Vavilov
`max_i` should also include the characters that were just read by `base64_decode_group_slow()`. PR-URL: https://github.com/nodejs/node/pull/13660 Fixes: https://github.com/nodejs/node/issues/13636 Fixes: https://github.com/nodejs/node/issues/13657 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-04buffer: optimize decoding wrapped base64 dataAlexey Orlenko
The fast base64 decoder used to switch to the slow one permanently when it saw a whitespace or other garbage character. Since the most common situation such characters may be encountered in is line-wrapped base64 data, a more profitable strategy is to decode a single 24-bit group with the slow decoder and then continue running the fast algorithm. PR-URL: https://github.com/nodejs/node/pull/12146 Ref: https://github.com/nodejs/node/issues/12114 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-31src: fix base64 decodingNikolai Vavilov
Make sure trailing garbage is not treated as a valid base64 character. Fixes: https://github.com/nodejs/node/issues/11987 PR-URL: https://github.com/nodejs/node/pull/11995 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-23string_bytes: Make base64 encode/decode reusableEugene Ostroukhov
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (https://github.com/nodejs/node/pull/6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header. PR-URL: https://github.com/nodejs/node/pull/6910 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>