JSFiddle - React, Tailwind, and code Playground

HTML

<input type="file" onchange="hash()" /><br />

JavaScript

async function hash() {
  const content = document.querySelector(".content");
  const [file] = document.querySelector("input[type=file]").files;

  if (file) {
    console.time("hash time");

    const hash = await crypto.subtle.digest(
      "SHA-256",
      await file.arrayBuffer()
    );

    // lol js
    const array = Array.from(new Uint8Array(hash));
    const hex = array.map((b) => b.toString(16).padStart(2, "0")).join("");

    console.timeEnd("hash time"); // in the actual browser console
    console.log(hex);
  }
}