Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract duplicate implementation of InfoHash struct #360

Closed
josecelano opened this issue Aug 4, 2023 · 2 comments · Fixed by #1066
Closed

Extract duplicate implementation of InfoHash struct #360

josecelano opened this issue Aug 4, 2023 · 2 comments · Fixed by #1066
Assignees
Labels
- Developer - Torrust Improvement Experience Build | Project System Compiling and Packaging Code Cleanup / Refactoring Tidying and Making Neat
Milestone

Comments

@josecelano
Copy link
Member

josecelano commented Aug 4, 2023

Relates to:

We are duplicating code for:

pub struct InfoHash(pub [u8; 20]);

We should extract a common BitTorrent protocol crate for both the Tracker and the Index Backend.

@josecelano
Copy link
Member Author

Hi @da2ce7 I would like to do this. Which package could we include this mod in? bittorrent?

@cgbosse cgbosse modified the milestones: v3.0.0, v3.1.0 Jul 3, 2024
@josecelano
Copy link
Member Author

I'm extracting the info-hash mod into a new crate:

https://github.com/torrust/bittorrent-primitives

The info-hash mod in the Tracker is newer than the one in the Index. Later on, I will replace the info-hash mod in the Index with this new extracted version.

@github-project-automation github-project-automation bot moved this from Maintenance to Done in Torrust Solution Oct 31, 2024
josecelano added a commit to torrust/torrust-index that referenced this issue Oct 31, 2024
…struct

569fbd2 chore: remove unused dep binascii (Jose Celano)
e58b314 refactor: replace InfoHash with external extracted crate (Jose Celano)
912715f feat: add dep bittorrent-primitives (Jose Celano)

Pull request description:

  Relates to:
    - torrust/torrust-tracker#360
    - torrust/torrust-tracker#1066

  The `InfoHash` type was duplicated here and in the [Tracker](torrust/torrust-tracker#360). I've extracted it into a new crate:

  https://github.com/torrust/bittorrent-primitives

ACKs for top commit:
  josecelano:
    ACK 569fbd2

Tree-SHA512: a09f849555067a08efe4609c68d38ca690ef7d3d795b81deeb3b6aa8f2cfa235082620745835f26155b80076a78f23c8eb99f46dbfb46a5da67a9c8b54c64691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Developer - Torrust Improvement Experience Build | Project System Compiling and Packaging Code Cleanup / Refactoring Tidying and Making Neat
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants