dojox/encoding/easy64.js

  • Provides:

    • dojox.encoding.easy64
  • dojox.encoding.easy64.encode

    • type
      Function
    • parameters:
      • input: (typeof Array)
        an array of numbers (0-255) to encode
    • source: [view]
        var result = [], reminder = input.length % 3, length = input.length - reminder;
        c(input, length, result);
        if(reminder){
         var t = input.slice(length);
         while(t.length < 3){ t.push(0); }
         c(t, 3, result);
         for(var i = 3; i > reminder; result.pop(), --i);
        }
        return result.join(""); // String
    • summary
      encodes input data in easy64 string
    • returns
      String
  • dojox.encoding.easy64.decode

    • type
      Function
    • parameters:
      • input: (typeof String)
        the input string to decode
    • source: [view]
        var n = input.length, r = [], b = [0, 0, 0, 0], i, j, d;
        for(i = 0; i < n; i += 4){
         for(j = 0; j < 4; ++j){ b[j] = input.charCodeAt(i + j) - 33; }
         d = n - i;
         for(j = d; j < 4; b[++j] = 0);
         r.push(
          (b[0] << 2) + (b[1] >>> 4),
          ((b[1] & 15) << 4) + (b[2] >>> 2),
          ((b[2] & 3) << 6) + b[3]
         );
         for(j = d; j < 4; ++j, r.pop());
        }
        return r;
    • summary
      decodes the input string back to array of numbers
  • dojox.encoding.easy64

    • type
      Object
    • summary
  • dojox.encoding

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary