aboutsummaryrefslogtreecommitdiff
path: root/third_party/websockify/tests/base64.js
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/websockify/tests/base64.js')
-rw-r--r--third_party/websockify/tests/base64.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/websockify/tests/base64.js b/third_party/websockify/tests/base64.js
new file mode 100644
index 00000000..6ade00a3
--- /dev/null
+++ b/third_party/websockify/tests/base64.js
@@ -0,0 +1,12 @@
+// The following results in 'hello [MANGLED]'
+//
+// Filed as https://github.com/ry/node/issues/issue/402
+
+var sys = require("sys"),
+ buf = new Buffer(1024), len,
+ str1 = "aGVsbG8g", // 'hello '
+ str2 = "d29ybGQ=", // 'world'
+
+len = buf.write(str1, 0, 'base64');
+len += buf.write(str2, len, 'base64');
+sys.log("decoded result: " + buf.toString('binary', 0, len));