UNPKG

entity-locker-sdk

Version:

Node.js SDK for DigiLocker's Entity Locker integration

14 lines (12 loc) 335 B
const crypto = require('crypto'); exports.base64url = (input) => { return input.toString('base64') .replace(/=/g, '') .replace(/\+/g, '-') .replace(/\//g, '_'); }; exports.hmacSHA256 = (data, key) => { const hmac = crypto.createHmac('sha256', key); hmac.update(data); return hmac.digest('base64'); };