code: function seed(key) {
      if (key === undefined) {
        key = new Array(N);
        for (var k = 0; k < N; k++) {
          key[k] = Math.floor(Math.random() * N);
        }
      } else if (typeof key === "string") {
        // to string
        key = "" + key;
        key = key.split("").map(function (c) { return c.charCodeAt(0) % N; });
      } else if (Array.isArray(key)) {
        if (!key.every(function (v) {
          return typeof v === "number" && v === (v | 0);
        })) {
          throw new TypeError("invalid seed key specified: not array of integers");
        }
      } else {
        throw new TypeError("invalid seed key specified");
      }
  
      var keylen = key.length;
  
      // resed state
      var s = identityPermutation();
  
      var j = 0;
      for (var i = 0; i < N; i++) {
        j = (j + s[i] + key[i % keylen]) % N;
        var tmp = s[i];
        s[i] = s[j];
        s[j] = tmp;
      }
  
      return s;
    }
docs: :: string | array integer -> array integer