#string-interning #symbols #interning #string

no-std string-hash-interner

Efficient string interner with minimal memory footprint and fast access to the underlying strings

1 unstable release

Uses new Rust 2024

0.20.0 Mar 1, 2025
0.19.0 Mar 1, 2025

#1619 in Data structures

Download history 116/week @ 2025-02-23 159/week @ 2025-03-02 6/week @ 2025-03-09

281 downloads per month

MIT/Apache

36KB
647 lines

String Hash Interner

A fork of robbepop/string-interner.

The main point of this fork is that the hashes of the strings interned are cached, and can be cheaply looked up with Interner::get_hash and Interner::get_hash_unchecked.

I only implemented this for the "String Backend", as that's the only backend I need. Figuring out how to implement this for other backends or make an interface with ability for backends to support this optionally is too complicated, so other backends were just removed.

This fork also makes the Interner generic over the type of strings interned. String types that are supported are: str, CStr, OsStr, [u8], [char].

Dependencies

~520–790KB
~12K SLoC