UNPKG

@paddle/paddle-node-sdk

Version:

A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.

14 lines (13 loc) 365 B
import { createHmac, randomUUID } from 'node:crypto'; export class NodeCrypto { randomUUID() { return randomUUID(); } async computeHmac(payload, secret) { const hmac = createHmac('sha256', secret); hmac.update(payload); return await new Promise((resolve) => { resolve(hmac.digest('hex')); }); } }