]>
git.proxmox.com Git - mirror_novnc.git/blob - tests/base64.js
1 // The following results in 'hello [MANGLED]'
3 // Filed as https://github.com/ry/node/issues/issue/402
5 var sys
= require("sys"),
6 buf
= new Buffer(1024), len
,
7 str1
= "aGVsbG8g", // 'hello '
8 str2
= "d29ybGQ=", // 'world'
10 len
= buf
.write(str1
, 0, 'base64');
11 len
+= buf
.write(str2
, len
, 'base64');
12 sys
.log("decoded result: " + buf
.toString('binary', 0, len
));