torrust-index icon indicating copy to clipboard operation
torrust-index copied to clipboard

Extract duplicate implementation of `InfoHash` struct

Open josecelano opened this issue 2 years ago • 1 comments

Relates to: https://github.com/torrust/torrust-tracker/issues/360

We are duplicating code for:

pub struct InfoHash(pub [u8; 20]);` struct
  • https://github.com/torrust/torrust-tracker/blob/develop/src/shared/bit_torrent/info_hash.rs#L136-L167
  • https://github.com/torrust/torrust-index-backend/blob/develop/src/models/info_hash.rs#L136-L167

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

josecelano avatar Aug 04 '23 15:08 josecelano

Documentation for the InfoHash have been improved here:

https://github.com/torrust/torrust-index-backend/pull/249/commits/bc04231c1d475cd323a8f6adb594c2dbaed052cc

josecelano avatar Aug 04 '23 15:08 josecelano