Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function hash (jwt) {
const parts = jwt.match(/^([a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+)\./)
return Buffer.from(sha256.arrayBuffer(parts[1]))
}
function hash (payload) {
return Buffer.from(sha256.arrayBuffer(payload))
}
export function sha256 (payload) {
return Buffer.from(sha256js.arrayBuffer(payload))
}