fix base54
authorCheng Liangyu <clyfish@gmail.com>
Mon, 1 Dec 2014 05:16:44 +0000 (13:16 +0800)
committerCheng Liangyu <clyfish@gmail.com>
Mon, 1 Dec 2014 05:16:44 +0000 (13:16 +0800)
lib/scope.js

index 6f29921..d252d53 100644 (file)
@@ -471,7 +471,9 @@ var base54 = (function() {
     base54.freq = function(){ return frequency };
     function base54(num) {
         var ret = "", base = 54;
+        num++;
         do {
+            num--;
             ret += String.fromCharCode(chars[num % base]);
             num = Math.floor(num / base);
             base = 64;