code: async function purejs(key, data, hash){
    const B = params.hashes[hash].blockSize;
    const L = params.hashes[hash].hashSize;
  
    if(key.length > B) key = await jschash.compute(key, hash);
  
    const K = new Uint8Array(B); // first the array is initialized with 0x00
    K.set(key);
  
    const KxorIpad = K.map( (k) => 0xFF & (0x36 ^ k));
    const KxorOpad = K.map( (k) => 0xFF & (0x5c ^ k));
  
    const inner = new Uint8Array(B + data.length);
    inner.set(KxorIpad);
    inner.set(data, B);
    const hashedInner = await jschash.compute(inner, hash);
  
    const outer = new Uint8Array(B + L);
    outer.set(KxorOpad);
    outer.set(hashedInner, B);
  
    return await jschash.compute(outer, hash);
  }
docs: PureJS implementation of HMAC algorithm specified in RFC 2104 {@link https://tools.ietf.org/html/rfc2104}.
  @param {Uint8Array} key - ByteArray of symmetric key.
  @param {Uint8Array} data - Byte array of message to be hashed.
  @param {String} hash - Name of hash algorithm like 'SHA-256'.
  @return {Promise<void>} - Keyed-hash value.