Fix btoa to match browser implementations

Test case:
btoa(String.fromCharCode(252)) should return "/A=="
This commit is contained in:
Victor Costan 2012-09-13 02:08:20 -03:00
parent 48288ef240
commit 133496cd12
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
"use strict";
function btoa(str) {
return new Buffer(str, 'utf8').toString('base64');
return new Buffer(str, 'binary').toString('base64');
}
module.exports = btoa;