@apocentre/bc-ur
Version:
A JS implementation of the Uniform Resources (UR) specification from Blockchain Commons
14 lines • 475 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cborDecode = exports.cborEncode = void 0;
const cbor = require('cbor-sync');
// const cbor = require('cbor-js');
const cborEncode = (data) => {
return cbor.encode(data);
};
exports.cborEncode = cborEncode;
const cborDecode = (data) => {
return cbor.decode(Buffer.isBuffer(data) ? data : Buffer.from(data, 'hex'));
};
exports.cborDecode = cborDecode;
//# sourceMappingURL=cbor.js.map