Expand description
Binary file detection utilities
Provides heuristics to determine whether a file (or byte slice) should be considered binary. The implementation favors determinism and avoids false positives by combining null-byte checks with a ratio of printable characters.
Functionsยง
- is_
binary_ bytes - Determine if the provided byte slice should be treated as binary.
- is_
binary_ file - Detect whether a file at
pathis likely binary by sampling the first 8 KiB.