code: async function mgf1(seed, len, hash = 'SHA-256'){
    const hashSize = params.hashes[hash].hashSize;
    const blockLen = Math.ceil(len/ hashSize);
  
    const t = new Uint8Array(blockLen*hashSize);
  
    for(let i = 0; i < blockLen; i++) {
      const c = i2osp(i, 4);
      const x = new Uint8Array(seed.length + 4);
      x.set(seed);
      x.set(c, seed.length);
      const y = await jschash.compute(x, hash);
      t.set(y, i * hashSize);
    }
    return t.slice(0, len);
  }
docs: Mask generation function 1 (MGF1)
  @param {Uint8Array} seed - Seed.
  @param {Number} len - Length of mask.
  @param {String} [hash='SHA-256'] - Name of hash algorithm.
  @return {Promise<Uint8Array>}: Generated mask.