diff --git a/lib/urlsafe-base64.js b/lib/urlsafe-base64.js index 7f26afa..068a4e2 100644 --- a/lib/urlsafe-base64.js +++ b/lib/urlsafe-base64.js @@ -56,7 +56,7 @@ exports.decode = function decode(base64) { .replace(/\-/g, '+') // Convert '-' to '+' .replace(/\_/g, '/'); // Convert '_' to '/' - return new Buffer(base64, 'base64'); + return Buffer.from(base64).toString('base64'); }; @@ -74,4 +74,4 @@ exports.validate = function validate(base64) { return /^[A-Za-z0-9\-_]+$/.test(base64); -}; \ No newline at end of file +};