Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | Cu.import("resource://services-sync/util.js"); |
michael@0 | 5 | |
michael@0 | 6 | function run_test() { |
michael@0 | 7 | do_check_eq(Utils.encodeKeyBase32("foobarbafoobarba"), "mzxw6ytb9jrgcztpn5rgc4tcme"); |
michael@0 | 8 | do_check_eq(Utils.decodeKeyBase32("mzxw6ytb9jrgcztpn5rgc4tcme"), "foobarbafoobarba"); |
michael@0 | 9 | do_check_eq( |
michael@0 | 10 | Utils.encodeKeyBase32("\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"), |
michael@0 | 11 | "aeaqcaibaeaqcaibaeaqcaibae"); |
michael@0 | 12 | do_check_eq( |
michael@0 | 13 | Utils.decodeKeyBase32("aeaqcaibaeaqcaibaeaqcaibae"), |
michael@0 | 14 | "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"); |
michael@0 | 15 | } |