@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
34 lines (33 loc) • 1.01 kB
JavaScript
/*
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
* This file is part of Sync-in | The open source file sync and share solution
* See the LICENSE file for licensing details
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "qrcodeToDataURL", {
enumerable: true,
get: function() {
return qrcodeToDataURL;
}
});
const _qrcodegenerator = /*#__PURE__*/ _interop_require_default(require("qrcode-generator"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function qrcodeToDataURL(text) {
const qr = (0, _qrcodegenerator.default)(0, 'M') // version auto, correction M
;
qr.addData(text);
qr.make();
const svg = qr.createSvgTag({
margin: 2,
scalable: true
});
const base64 = Buffer.from(svg).toString('base64');
return `data:image/svg+xml;base64,${base64}`;
}
//# sourceMappingURL=qrcode.js.map