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

Method encodeChar

src/core/datamatrix/encoder/EdifactEncoder.ts:112–120  ·  view source on GitHub ↗
(c: number, sb: StringBuilder)

Source from the content-addressed store, hash-verified

110 }
111
112 private encodeChar(c: number, sb: StringBuilder) {
113 if (c >= ' '.charCodeAt(0) && c <= '?'.charCodeAt(0)) {
114 sb.append(c);
115 } else if (c >= '@'.charCodeAt(0) && c <= '^'.charCodeAt(0)) {
116 sb.append(StringUtils.getCharAt(c - 64));
117 } else {
118 HighLevelEncoder.illegalCharacter(StringUtils.getCharAt(c));
119 }
120 }
121
122 private encodeToCodewords(sb: string): string {
123 const len = sb.length;

Callers 1

encodeMethod · 0.95

Calls 3

appendMethod · 0.80
getCharAtMethod · 0.80
illegalCharacterMethod · 0.80

Tested by

no test coverage detected