Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed May 6, 2021
1 parent 19c2f3d commit 4f5368e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,9 @@ const lazyInvalidCharError = hideStackFrames((message, name) => {
});

function btoa(input) {
// The implementation here has not been performance optimized in any way and
// should not be.
// Refs: https://github.com/nodejs/node/pull/38433#issuecomment-828426932
input = `${input}`;
for (let n = 0; n < input.length; n++) {
if (input[n].charCodeAt(0) > 0xff)
Expand All @@ -1233,6 +1236,9 @@ const kBase64Digits =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

function atob(input) {
// The implementation here has not been performance optimized in any way and
// should not be.
// Refs: https://github.com/nodejs/node/pull/38433#issuecomment-828426932
input = `${input}`;
for (let n = 0; n < input.length; n++) {
if (!kBase64Digits.includes(input[n]))
Expand Down

0 comments on commit 4f5368e

Please sign in to comment.