juice-shop/juice-shop-ctf

View on GitHub
lib/hmac.js

Summary

Maintainability
A
0 mins
Test Coverage
/*
 * Copyright (c) 2016-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
 * SPDX-License-Identifier: MIT
 */

const jsSHA = require('jssha')

function hmacSha1 (secretKey, text) {
  const shaObj = new jsSHA('SHA-1', 'TEXT') // eslint-disable-line new-cap
  shaObj.setHMACKey(secretKey, 'TEXT')
  shaObj.update(text)
  return shaObj.getHMAC('HEX')
}
module.exports = hmacSha1