Skip to content

Instantly share code, notes, and snippets.

View adrianvellamlt's full-sized avatar
👋
working on some cool stuff

Adrian Vella adrianvellamlt

👋
working on some cool stuff
View GitHub Profile
const crypto = require('crypto');
const hmac = crypto.createHmac('SHA256', 'my-webhook-secret');
hmac.update('{ ... }'); // request body
const correctHash = hmac.digest().toString('hex');
const receivedHash = '...'; // e.g. req.get('x-impala-signature');
/*
* It's important to perform a constant time equality comparison of the
@DraTeots
DraTeots / HighResolutionTimer.cs
Last active February 22, 2024 11:38
HighResolutionTimer for .NET
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
namespace HighResolutionTimer
{