MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / decodeHex

Function decodeHex

src/tools/filesystem/pdf-read.ts:208–218  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

206}
207
208function decodeHex(s: string): string {
209 const clean = s.replace(/\s+/g, '');
210 // Pad odd length per PDF spec
211 const padded = clean.length % 2 === 0 ? clean : clean + '0';
212 let result = '';
213 for (let i = 0; i < padded.length; i += 2) {
214 const code = parseInt(padded.slice(i, i + 2), 16);
215 if (!isNaN(code)) result += String.fromCharCode(code);
216 }
217 return result;
218}
219
220function parsePageRange(spec: string, total: number): Set<number> {
221 const wanted = new Set<number>();

Callers 1

extractTextFromStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected