https://github.com/anonrig/string_interner
A fast and efficient string interning for Rust
https://github.com/anonrig/string_interner
rust string-interning
Last synced: about 2 months ago
JSON representation
A fast and efficient string interning for Rust
- Host: GitHub
- URL: https://github.com/anonrig/string_interner
- Owner: anonrig
- License: mit
- Created: 2024-01-04T15:50:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-07T19:52:33.000Z (over 1 year ago)
- Last Synced: 2025-04-15T12:52:33.515Z (about 2 months ago)
- Topics: rust, string-interning
- Language: Rust
- Homepage: https://crates.io/crates/intern_string
- Size: 26.4 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## String Interning
Fast and efficient string interning with a simple API.
### Features
- Intern strings and get a unique ID for each string.
- Initialize with a pre-allocated capacity.### Installation
Add the following to your `Cargo.toml`:
```toml
[dependencies]
intern_string = "0.1.0"
```### Usage
```rust
use intern_string::Intern;let mut interner = Intern::new();
let id = interner.intern("hello");
assert_eq!(interner.lookup(id), 0);
```