UNPKG

@node-dlc/crypto

Version:
8 lines (6 loc) 198 B
import crypto from 'crypto'; export function hmac(key: Buffer, data: Buffer, algorithm = 'sha256'): Buffer { const h = crypto.createHmac(algorithm, key); h.update(data); return h.digest(); }