code: function ARC4(key) {
    var t, keylen = key.length,
        me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
  
    // The empty key [] is treated as [0].
    if (!keylen) { key = [keylen++]; }
  
    // Set up S using the standard key scheduling algorithm.
    while (i < width) {
      s[i] = i++;
    }
    for (i = 0; i < width; i++) {
      s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
      s[j] = t;
    }
  
    // The "g" method returns the next (count) outputs as one number.
    (me.g = function(count) {
      // Using instance members instead of closure state nearly doubles speed.
      var t, r = 0,
          i = me.i, j = me.j, s = me.S;
      while (count--) {
        t = s[i = mask & (i + 1)];
        r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
      }
      me.i = i; me.j = j;
      return r;
      // For robust unpredictability discard an initial batch of values.
      // See http://www.rsa.com/rsalabs/node.asp?id=2009
    })(width);
  }
docs: ARC4  An ARC4 implementation.  The constructor takes a key in the form of an array of at most (width) integers that should be 0 <= x < (width).  The g(count) method returns a pseudorandom integer that concatenates the next (count) outputs from ARC4.  Its return value is a number x that is in the range 0 <= x < (width ^ count).  @constructor