@gandlaf21/bc-ur
Version:
A JS implementation of the Uniform Resources (UR) specification from Blockchain Commons
14 lines (13 loc) • 492 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cborDecode = exports.cborEncode = void 0;
var buffer_1 = require("buffer");
var cborg_1 = require("cborg");
var cborEncode = function (data) {
return buffer_1.Buffer.from(cborg_1.encode(data));
};
exports.cborEncode = cborEncode;
var cborDecode = function (data) {
return cborg_1.decode(buffer_1.Buffer.isBuffer(data) ? data : buffer_1.Buffer.from(data, 'hex'));
};
exports.cborDecode = cborDecode;