Skip to content

Instantly share code, notes, and snippets.

View daniel-schwartz-k's full-sized avatar

Daniel Schwartz daniel-schwartz-k

View GitHub Profile
@robingustafsson
robingustafsson / jwt.js
Created October 14, 2017 20:16
Simple JWT example for k6 load testing tool
import crypto from "k6/crypto";
import encoding from "k6/encoding";
const algToHash = {
HS256: "sha256",
HS384: "sha384",
HS512: "sha512"
};
function sign(data, hashAlg, secret) {