cargo / memchr

memchr

cargo

Provides extremely fast (uses SIMD on x86_64, aarch64 and wasm32) routines for 1, 2 or 3 byte search and single substring search.

Audits

PE Patrick Elsen 2026-06-02

memchr@2.8.1

memchr 2.8.1 is a #![no_std] library providing SIMD-accelerated byte and substring search (Two-Way, Rabin-Karp, Shift-Or, plus per-arch SSE2/AVX2/NEON/simd128). No build.rs, no proc macros, no I/O, two optional deps. The crate uses extensive unsafe for SIMD intrinsics and raw-pointer loops, but every boundary carries a # Safety block, quickcheck property tests check each implementation against a naive reference, and the upstream tree has miri configuration and 8 cargo-fuzz targets. No findings.

algorithm-impl-boundsalgorithm-impl-correctalgorithm-impl-safealgorithm-impl-testedhas-binarieshas-build-exechas-fuzz-testshas-install-exechas-integration-testshas-property-testshas-unit-testsimpl-algorithmimpl-concurrencyimpl-cryptoimpl-datastructureimpl-interpreterimpl-jitimpl-parserimpl-protocolis-benignunsafe-documentedunsafe-minimalunsafe-safeunsafe-testeduses-concurrencyuses-cryptouses-environmentuses-execuses-filesystemuses-interpreteruses-jituses-networkuses-unsafe
PE Patrick Elsen 2026-05-28

memchr@2.8.0

memchr 2.8.0 implements SIMD-accelerated byte search (1/2/3 needles, forward/reverse) and substring search for arbitrary byte slices. The 325 unsafe blocks are confined to SIMD intrinsics, pointer-walking loops, and CPU dispatch; each carries a SAFETY comment and the AVX2 path is gated behind a runtime feature check. Quickcheck property tests and upstream cargo-fuzz targets cover all search variants. No findings.

algorithm-impl-boundsalgorithm-impl-correctalgorithm-impl-safealgorithm-impl-testedhas-binarieshas-build-exechas-fuzz-testshas-install-exechas-integration-testshas-property-testshas-unit-testsimpl-algorithmimpl-concurrencyimpl-cryptoimpl-datastructureimpl-interpreterimpl-jitimpl-parserimpl-protocolis-benignunsafe-documentedunsafe-minimalunsafe-safeunsafe-testeduses-concurrencyuses-cryptouses-environmentuses-execuses-filesystemuses-interpreteruses-jituses-networkuses-unsafe