MCPcopy Create free account
hub / github.com/LibPDF-js/core / byteLength

Function byteLength

src/parser/document-parser.test.ts:36–36  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

34 // Track offsets for xref (byte lengths, not string lengths — the binary
35 // marker encodes to multiple UTF-8 bytes per char)
36 const byteLength = (s: string): number => new TextEncoder().encode(s).length;
37
38 const offsets: Array<{ objNum: number; offset: number; gen: number; free: boolean }> = [];
39 let currentOffset = byteLength(parts.join(""));

Callers 1

createMinimalPdfFunction · 0.85

Calls 1

encodeMethod · 0.65

Tested by

no test coverage detected