Skip to content

Instantly share code, notes, and snippets.

@ThomasRettig
Created March 14, 2022 15:35
Show Gist options
  • Save ThomasRettig/5db4104d75b5cf757b67522cd662b0c2 to your computer and use it in GitHub Desktop.
Save ThomasRettig/5db4104d75b5cf757b67522cd662b0c2 to your computer and use it in GitHub Desktop.
Little Node.js experiment which uses the `crypto` library to hash a string with the sha256 algorithm.
const { createHmac } = await import("crypto");
const secret = "blah blah";
const hash = createHmac("sha256", secret)
.update("Blah Blah")
.digest("hex");
console.log(hash);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment