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 13 | 42x 43x 42x 42x 43x 43x 43x | import { ensureUint8Array } from 'micro-stacks/common'; import { hmac } from '@noble/hashes/hmac'; import { sha256 } from '@noble/hashes/sha256'; export function hmacSha256(key: Uint8Array, ...messages: Uint8Array[]): Uint8Array { const hash = hmac.create(sha256, ensureUint8Array(key)); for (const message of messages) { hash.update(ensureUint8Array(message)); } return Uint8Array.from(hash.digest()); } |