fixed mixup of atob / btoa

This commit is contained in:
AJ ONeal 2011-09-09 14:56:22 -06:00
parent aacae887e8
commit 65407a29d0
2 changed files with 4 additions and 3 deletions

View File

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

View File

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