binary2strings

raw JSON →
0.1.13 verified Fri May 01 auth: no python

A Python library for fast extraction of ASCII, UTF-8, and UTF-16 strings from binary buffers, using a C backend for performance. Current version: 0.1.13. Release cadence: irregular.

pip install binary2strings
error ModuleNotFoundError: No module named 'binary2strings'
cause Library not installed or installed in a different Python environment.
fix
Run 'pip install binary2strings' and ensure you are using the correct Python interpreter.
error ImportError: cannot import name 'extract_all_strings' from 'binary2strings'
cause Attempting a direct import that doesn't match the module structure.
fix
Use 'from binary2strings import extract_ascii_strings' or call 'binary2strings.extract_all_strings()' without importing the function name.
error binary2strings.extract_all_strings() missing 1 required positional argument: 'data'
cause Forgetting to pass the bytes-like object or passing it as a keyword argument incorrectly.
fix
Call 'binary2strings.extract_all_strings(data)' where data is a bytes, bytearray, or numpy array.
gotcha The library returns strings along with their byte offset and encoding type. The encoding field is a string like 'ASCII' or 'UTF-16LE', not a Python codec name. Do not pass it directly to str.encode().
fix Use the encoding string only for informational purposes or map it manually to a standard codec.
deprecated extract_ascii_strings and extract_unicode_strings may be deprecated in future; use extract_all_strings with the min_bytes and encoding filter parameters instead.
fix Use binary2strings.extract_all_strings(data, min_bytes=4, ascii_only=True) to replicate ASCII-only extraction.
gotcha The minimum string length parameter (min_bytes) defaults to 4. Short strings like 'AB' are ignored unless you set min_bytes=2.
fix Pass min_bytes=2 or lower to extract shorter strings.