2011-09-09 20:56:22 +00:00
|
|
|
(function () {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
function btoa(str) {
|
2013-07-25 16:14:17 +00:00
|
|
|
var buffer
|
|
|
|
;
|
|
|
|
|
|
|
|
if (str instanceof Buffer) {
|
|
|
|
buffer = str;
|
|
|
|
} else {
|
|
|
|
buffer = new Buffer(str.toString(), 'binary');
|
|
|
|
}
|
|
|
|
|
|
|
|
return buffer.toString('base64');
|
2011-09-09 20:56:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = btoa;
|
|
|
|
}());
|