Skip to main content

Module binary

Module binary 

Source
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 path is likely binary by sampling the first 8 KiB.