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.

18 lines (17 loc) 527 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeCrypto = void 0; const node_crypto_1 = require("node:crypto"); class NodeCrypto { randomUUID() { return (0, node_crypto_1.randomUUID)(); } async computeHmac(payload, secret) { const hmac = (0, node_crypto_1.createHmac)('sha256', secret); hmac.update(payload); return await new Promise((resolve) => { resolve(hmac.digest('hex')); }); } } exports.NodeCrypto = NodeCrypto;