UNPKG

@stellot/crypto

Version:

Crypto libraries for front and backend

23 lines (22 loc) 657 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsbn_1 = require("jsbn"); class DecryptedValue { constructor(m) { switch (typeof m) { case 'number': this.bi = new jsbn_1.BigInteger(`${m}`); break; case 'bigint': this.bi = new jsbn_1.BigInteger(m.toString()); break; case 'object': default: this.bi = new jsbn_1.BigInteger(m.toString('hex'), 16); } } toString() { return new Buffer(this.bi.toByteArray()).toString(); } } exports.default = DecryptedValue;