MCPcopy Index your code
hub / github.com/simstudioai/sim / findSequence

Function findSequence

apps/sim/lib/pptx-renderer/utils/emf-parser.ts:273–279  ·  view source on GitHub ↗

* Find the first occurrence of a byte sequence in a buffer.

(buf: Uint8Array, seq: number[])

Source from the content-addressed store, hash-verified

271 * Find the first occurrence of a byte sequence in a buffer.
272 */
273function findSequence(buf: Uint8Array, seq: number[]): number {
274 const end = buf.length - seq.length
275 for (let i = 0; i <= end; i++) {
276 if (matchesAt(buf, i, seq)) return i
277 }
278 return -1
279}
280
281/**
282 * Check if buffer matches a byte sequence at a given offset.

Callers 1

extractPdfFromBufferFunction · 0.85

Calls 1

matchesAtFunction · 0.85

Tested by

no test coverage detected