MCPcopy
hub / github.com/zpao/qrcode.react / encodeBinary

Method encodeBinary

src/third-party/qrcodegen/index.ts:54–57  ·  view source on GitHub ↗
(data: Readonly<Array<byte>>, ecl: QrCode.Ecc)

Source from the content-addressed store, hash-verified

52 // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
53 // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
54 public static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode {
55 const seg: QrSegment = qrcodegen.QrSegment.makeBytes(data);
56 return QrCode.encodeSegments([seg], ecl);
57 }
58
59
60 /*-- Static factory functions (mid level) --*/

Callers

nothing calls this directly

Calls 2

makeBytesMethod · 0.80
encodeSegmentsMethod · 0.80

Tested by

no test coverage detected