MCPcopy Create free account
hub / github.com/devilsen/CZXing / GetPostCode2

Function GetPostCode2

czxing/src/main/cpp/zxing/src/maxicode/MCDecoder.cpp:140–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static std::string GetPostCode2(const ByteArray& bytes)
141{
142 unsigned int val = GetInt(bytes,
143 {33, 34, 35, 36, 25, 26, 27, 28, 29, 30, 19, 20, 21, 22, 23, 24, 13, 14, 15, 16, 17, 18, 7, 8, 9, 10, 11, 12, 1, 2});
144 unsigned int len = GetPostCode2Length(bytes);
145 // Pad or truncate to length
146 char buf[11]; // 30 bits 0x3FFFFFFF == 1073741823 (10 digits)
147 snprintf(buf, sizeof(buf), "%0*d", len, val);
148 buf[len] = '\0';
149 return buf;
150}
151
152static std::string GetPostCode3(const ByteArray& bytes)
153{

Callers 1

DecoderResult DecodeFunction · 0.85

Calls 2

GetIntFunction · 0.85
GetPostCode2LengthFunction · 0.85

Tested by

no test coverage detected