How to use the k6/crypto.sha512 function in k6

To help you get started, we’ve selected a few k6 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jembi / openhim-core-js / performance / auth.js View on Github external
export function getTestAuthHeaders () {
  const timestamp = new Date().toISOString()
  return {
    'auth-username': rootUser.email,
    'auth-ts': timestamp,
    'auth-salt': rootUser.salt,
    'auth-token': crypto.sha512(rootUser.hash + rootUser.salt + timestamp, 'hex')
  }
}