From 4f5368e2790f4944822584711b10482c0e32b9b1 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 6 May 2021 13:25:50 +0800 Subject: [PATCH] f --- lib/buffer.js | 6 ++++++ 1 file changed, 6 insertions(+) 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]))