code: function (input, alphabetName) {
          var alphabet = alphabets[alphabetName || 'ripple'],
              base     = new sjcl.bn(alphabet.length),
              bi       = sjcl.bn.fromBits(sjcl.codec.bytes.toBits(input)),
              buffer   = [];
  
          while (bi.greaterEquals(base)) {
            var mod = bi.mod(base);
            buffer.push(alphabet[mod.limbs[0]]);
            bi = bi.div(base);
          }
          buffer.push(alphabet[bi.limbs[0]]);
  
          // Convert leading zeros too.
          for (var i = 0; i != input.length && !input[i]; i += 1) {
            buffer.push(alphabet[0]);
          }
  
          return buffer.reverse().join("");
        }
docs: --> input: big-endian array of bytes. <-- string at least as long as input.