A fast, correct, pure-Elixir library for reading and writing Bencoded data and .torrent files.
Bento is a Bencoding library for Elixir that provides high-performance encoding and decoding of bencoded data, a format commonly used in BitTorrent. It ensures correctness by rejecting all malformed input and includes built-in support for parsing .torrent metainfo files. The library is implemented in pure Elixir, leveraging techniques like sub-binary matching and IO list encoding for speed.
Elixir developers working with bencoded data, such as those building or integrating with BitTorrent clients, peer-to-peer applications, or systems that handle .torrent files. It is also suitable for developers needing a fast, correct, and dependency-free bencoding solution.
Developers choose Bento for its combination of high performance—over 2x faster encoding than alternatives—and strict correctness guarantees, rejecting all malformed input. Its built-in .torrent decoder and ability to decode into custom Elixir structs offer flexibility and type safety not always available in other libraries.
:bento: A fast, correct, pure-Elixir library for reading and writing Bencoded metainfo (.torrent) files.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Achieves over 2x faster encoding than alternatives through techniques like sub-binary matching and IO list encoding, as demonstrated in benchmarks.
Rejects all malformed bencoded input, ensuring data integrity and correctness, which is critical for reliable bencoding operations.
Includes a dedicated .torrent file decoder that parses BitTorrent metainfo into structured Elixir data, simplifying torrent-related application development.
Supports decoding bencoded data into custom Elixir structs using the 'as' parameter, enabling type-safe and domain-specific data modeling.
Benchmarks reveal incompatibilities with other Elixir bencoding libraries (e.g., exbencode has build errors), indicating a limited or conflicting ecosystem.
Optimized specifically for bencoding and .torrent files, making it less suitable for projects needing multi-format serialization or broader data handling.
The README provides basic examples, but advanced usage and edge cases may require deeper digging into Hexdocs, which could hinder quick adoption.