aboutsummaryrefslogtreecommitdiff
path: root/third_party/websockify/tests/base64.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-30 10:24:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-30 10:24:53 -0700
commitb614f2bc5d9fc421565824b1ceb9a3384f26f35f (patch)
tree243c47baa4c6ce4273a5743d79f3c0dbc78789e5 /third_party/websockify/tests/base64.js
parentc70758e3b49beb016a3d9db7b609c499d55de48b (diff)
parent7eaa78060c34489c7e56193c725641303d520f31 (diff)
Merge branch 'incoming'
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));