diff --git a/lib/buffer.js b/lib/buffer.js index 3124941a549a56..bcb3cce52790c8 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -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) @@ -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]))