this post was submitted on 11 Apr 2025
42 points (100.0% liked)

Open Source

35686 readers
157 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
 

Been working on this the past couple months as an exercise in learning Rust. Just wanted to share how it's come so far!

torrentz2 (tz2) is an advanced, experimental utility for working with .torrent metadata files. It supports a wide array of BEPs and v1/v2/hybrid formats.

Features

  • Create, Edit, or Verify torrent files
  • Convenient config file to define default options and trackers
  • Multithreaded hashing
  • Include/exclude files based on globs and if they are symlinks
  • Create a single torrent file from disparate input paths, provided they share a common root
  • Intelligent automatic piece size selection with support for up to 64 MiB
  • Digitally sign/verify embedded signatures with standard X.509 certificates utilizing RSA or EC signatures
    • Includes utility command to generate an appropriate root CA and leaf cert
  • Optionally include md5 or sha1 sums per-file with v1 torrents

Optional Features

  • CPU hardware accelerated hashing (on by default)
  • GPU accelerated hashing (coming soon, maybe hopefully)
  • Compile to a static binary

Why another utility like this? Well, there wasn't one that met my requirements. That is, feature rich, oriented towards PT users, and supporting the v2 format. It's also, as far as I can tell, the only modern utility supporting the draft BEP 0035 (Torrent Signing). I intend to make use of this in a future project.

Right now all the main features are implemented, except the planned GPU hashing. Once I've had some more time to polish it up and write documentation, I intend to publish on crates.io. For now, if you'd like to try it out you can build from source, or I have some builds for x86_64 Linux available in the repo.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 18 hours ago

Impressive work, thanks!

[–] [email protected] 3 points 1 day ago (1 children)

Is there an overview of which BEPs are implemented?

[–] [email protected] 3 points 1 day ago

There is not, but I will add one.

[–] [email protected] 4 points 1 day ago* (last edited 1 day ago)

This is marvelous, but goddamn do I hate cross compiling rust projects from source.