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

Piece size selection reform #119

Closed
5 tasks done
casey opened this issue Jan 31, 2020 · 0 comments · Fixed by #144
Closed
5 tasks done

Piece size selection reform #119

casey opened this issue Jan 31, 2020 · 0 comments · Fixed by #144

Comments

@casey
Copy link
Owner

casey commented Jan 31, 2020

  • Support human readable piece sizes using SI units (kibi, gibi, etc.) defaulting to bytes if unmarked
  • Complain if piece size is less than 16KiB, for compatibility with BTv2 spec. Allow users to pass a flag to override. (Possibly a generic --allow CHECK flag that can be reused for other things.)
  • Complain if piece sizes are not a power of two. Allow overriding
  • Complain if piece size is zero
  • Come up with a reasonable default if piece size isn't supplied, depending on the amount of data in the torrent (1200 - 2200 pieces is recommended, max 16MiB min 16KiB), pyrocore uses:
    piece_size_exp = int(math.log(total_size) / math.log(2)) - 9
    piece_size_exp = min(max(15, piece_size_exp), 24)
    piece_size = 2 ** piece_size_exp
    
@casey casey added this to the soon milestone Jan 31, 2020
@casey casey changed the title Piece size reform Piece size selection reform Jan 31, 2020
@casey casey modified the milestones: soon, afoot Jan 31, 2020
@casey casey closed this as completed in #144 Feb 5, 2020
@casey casey modified the milestones: afoot, soon Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant