neilharvey / FileSignatures

A small library for detecting the type of a file based on header signature (also known as magic number).
MIT License
250 stars 41 forks source link

Ignore Whitespace #54

Open gorillapower opened 1 year ago

gorillapower commented 1 year ago

Is it possible to support ignoring whitespace characters at the beginning of a stream?

neilharvey commented 1 year ago

In the core library .. not really. It just reads a binary stream, whitespace assumes a text encoding.

That said, if you're doing some sort of detection based on text content what you could do is create a custom FileFormat and override IsMatch to skip over any whitespace.