Registry / data / binary2strings

binary2strings

JSON →
library0.1.13pypypiunverified

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
INSTALL
IMPORT
SIG · BINARY2STRINGS
B
binary2strings
datapythonv0.1.13
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

extract_ascii_strings
from binary2strings import extract_ascii_strings
from binary2strings import extract_all_strings
extract_all_strings does not exist; use extract_ascii_strings or other specific extractors
extract_unicode_strings
from binary2strings import extract_unicode_strings
Correct import for UTF-16 strings
extract_all_strings
import binary2strings
extract_all_strings is a function in the module namespace; call binary2strings.extract_all_strings()

Extract all strings (ASCII and Unicode) from a bytes object.

import binary2strings data = b'Hello\x00World' result = binary2strings.extract_all_strings(data) print(result) # Output: [('Hello', 0, 'UTF-16LE'), ('World', 6, 'UTF-16LE')]
Debug
Known issues
gotchaThe 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.
affects: all
deprecatedextract_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.
affects: 0.1.x
gotchaThe 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.
affects: all
Upgrade
Version history
0.1.13latest on PyPI · released Jul 20, 2023
Audit
Dependencies
numpyoptionalRequired for numpy array input support
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources