fixed mixup of atob / btoa

这个提交包含在:
AJ ONeal 2011-09-09 14:56:22 -06:00
父节点 aacae887e8
当前提交 65407a29d0
共有 2 个文件被更改,包括 4 次插入3 次删除

查看文件

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

查看文件

@ -2,11 +2,12 @@
"use strict";
var atob = require('./index')
, expected = "SGVsbG8gV29ybGQ="
, encoded = "SGVsbG8gV29ybGQ="
, unencoded = "Hello World"
, result
;
if (expected !== atob("Hello World")) {
if (unencoded !== atob(encoded)) {
return;
}