Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 | 42x 42x 42x 42x 4x 4x 4x | import { hmac } from '@noble/hashes/hmac'; import { sha512 } from '@noble/hashes/sha512'; import { ensureUint8Array } from 'micro-stacks/common'; export function hmacSha512(key: Uint8Array, ...messages: Uint8Array[]): Uint8Array { const hash = hmac.create(sha512, ensureUint8Array(key)); for (const message of messages) { hash.update(ensureUint8Array(message)); } return Uint8Array.from(hash.digest()); } |