From c391d903e3339583e88bcdf4793a5b82526af0ff Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Sat, 20 Jul 2013 09:22:32 -0700 Subject: [PATCH] Call toString on args to match browser behavior. --- btoa/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btoa/index.js b/btoa/index.js index 350cd4b..4c00e7b 100644 --- a/btoa/index.js +++ b/btoa/index.js @@ -2,7 +2,7 @@ "use strict"; function btoa(str) { - return new Buffer(str, 'binary').toString('base64'); + return new Buffer(str.toString(), 'binary').toString('base64'); } module.exports = btoa;