code: function finalizeSHA2(remainder, remainderBinLen, processedBinLen, H, variant)
  {
      var i, appendedMessageLength, offset, binaryStringInc;
  
      /* 32-bit variant */
      /* The 65 addition is a hack but it works.  The correct number is
         actually 72 (64 + 8) but the below math fails if
         remainderBinLen + 72 % 512 = 0. Since remainderBinLen % 8 = 0,
         "shorting" the addition is OK. */
      offset = (((remainderBinLen + 65) >>> 9) << 4) + 15;
      binaryStringInc = 16;
  
      while (remainder.length <= offset)
      {
          remainder.push(0);
      }
      /* Append '1' at the end of the binary string */
      remainder[remainderBinLen >>> 5] |= 0x80 << (24 - remainderBinLen % 32);
      /* Append length of binary string in the position such that the new
       * length is correct */
      remainder[offset] = remainderBinLen + processedBinLen;
  
      appendedMessageLength = remainder.length;
  
      /* This will always be at least 1 full chunk */
      for (i = 0; i < appendedMessageLength; i += binaryStringInc)
      {
          H = roundSHA2(remainder.slice(i, i + binaryStringInc), H, variant);
      }
  
      return H;
  }
docs: Finalizes the SHA-2 hash
  
  @private
  @param {Array.<number>} remainder Any leftover unprocessed packed ints
  that still need to be processed
  @param {number} remainderBinLen The number of bits in remainder
  @param {number} processedBinLen The number of bits already
  processed
  @param {Array.<number|Int_64>} H The intermediate H values from a previous
  round
  @param {string} variant The desired SHA-2 variant
  @return {Array.<number>} The array of integers representing the SHA-2
  hash of message