1export interface BinaryDetectionOptions {
2 /** Number of characters to check from the beginning of the file */
3 prefixLength: number;
4 /** Maximum ratio of suspicious characters allowed (0.0 to 1.0) */
5 suspiciousCharThresholdRatio: number;
6 /** Maximum absolute number of null bytes allowed */
7 maxAbsoluteNullBytes: number;
8}
9
10export const DEFAULT_BINARY_DETECTION_OPTIONS: BinaryDetectionOptions = {
11 prefixLength: 1024 * 10, // Check the first 10KB of the string
12 suspiciousCharThresholdRatio: 0.15, // Allow up to 15% suspicious chars
13 maxAbsoluteNullBytes: 2
14};