From f76c0404fb8ec18cfecc65b269fe0a3815d9437c 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. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 350cd4b..4c00e7b 100644 --- a/index.js +++ b/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;