MCPcopy
hub / github.com/zxing-js/library / encodeToCodewords

Method encodeToCodewords

src/core/datamatrix/encoder/C40Encoder.ts:242–253  ·  view source on GitHub ↗
(sb: string)

Source from the content-addressed store, hash-verified

240 }
241
242 private encodeToCodewords(sb: string): string {
243 const v =
244 1600 * sb.charCodeAt(0) + 40 * sb.charCodeAt(1) + sb.charCodeAt(2) + 1;
245 const cw1 = v / 256;
246 const cw2 = v % 256;
247
248 const result = new StringBuilder();
249 result.append(cw1);
250 result.append(cw2);
251
252 return result.toString();
253 }
254}

Callers 1

writeNextTripletMethod · 0.95

Calls 2

appendMethod · 0.95
toStringMethod · 0.95

Tested by

no test coverage detected