MCPcopy
hub / github.com/latentcat/qrbtf / encodeData

Function encodeData

src/utils/qrcodeHandler.js:16–34  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

14}
15
16export function encodeData(options) {
17 if (!options.text || options.text.length <= 0) return null
18
19 options = extend({
20 render : "canvas",
21 width : 256,
22 height : 256,
23 typeNumber : -1,
24 correctLevel : 1,
25 background : "#ffffff",
26 foreground : "#000000"
27 }, options);
28
29 let qrcode = new QRCodeEncoder(options.typeNumber, options.correctLevel)
30 qrcode.addData(options.text)
31 qrcode.make()
32
33 return qrcode;
34}
35
36export function getTypeTable(qrcode) {
37 const nCount = qrcode.getModuleCount();

Callers 2

index.jsFile · 0.90
appReducerFunction · 0.90

Calls 1

extendFunction · 0.90

Tested by

no test coverage detected