UNPKG

onoffice

Version:

OnOffice typescript api client and sdk

13 lines (12 loc) 529 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.hmac = void 0; const crypto_js_1 = __importDefault(require("crypto-js")); function hmac(value, secret) { //this is the only way I've found to emulate php hash_hmac in binary mode return crypto_js_1.default.HmacSHA256(value, secret).toString(crypto_js_1.default.enc.Base64); } exports.hmac = hmac;