# BurntSushi/bstr

A string type for Rust that is not required to be valid UTF-8.

Repository: https://github.com/BurntSushi/bstr
Canonical: https://ross.abutalabs.com/products/bstr
Language: Rust
License: NOASSERTION
License Family: other
Topics: bytes, unicode, byte-string, utf-8, substring-search, substring, graphemes
Last push: 2026-08-10T11:12:13+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 35, longevity 100
- inputs: {"age_days": 2760, "days_push": 23, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1110, forks 76 (observed 2026-08-28T04:03:37.570571+00:00)

## What it is
bstr is a Rust crate providing a byte string type and extension traits for &[u8] and Vec<u8> that are not required to be valid UTF-8. It offers Unicode-aware operations like substring search, case conversion, grapheme iteration, and line-oriented I/O helpers that tolerate invalid UTF-8.

## Use cases
- process byte data that may not be valid UTF-8 in Rust
- search for substrings in binary or mixed-encoding data
- iterate over lines of stdin without UTF-8 validation
- count Unicode words in byte streams
- convert byte text to uppercase while passing invalid UTF-8 through
- extract grapheme clusters from possibly-invalid UTF-8 text

## When to choose
- you need string-like operations on bytes that may be partially or fully invalid UTF-8
- you want Unicode-aware substring search and grapheme handling on byte slices
- you are writing CLI tools or parsers that must handle arbitrary input bytes

## When to avoid
- your data is guaranteed valid UTF-8 and std's str/String suffices
- you need a general-purpose binary serialization format rather than string handling

## Facets
- artifact type: library
- maturity: stable
- function: parser, serialization, developer-tools
- domain: programming-languages, developer-tools
- platform: rust, cross-platform
- tags: byte-strings, utf-8, unicode, substring-search, graphemes, no-std-friendly, natural-language-processing

## Member repositories
- BurntSushi/bstr (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:37.570571+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:43:25.322355+00:00, confidence not recorded.
  - readme: https://github.com/BurntSushi/bstr (fetched 2026-08-28T04:03:37.570571+00:00, sha 4af7f193c04b)
  - registry_crates: https://crates.io/api/v1/crates/bstr (fetched 2026-08-29T12:46:44.337077+00:00, sha fb2ac36e9ba2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
