Skip to content

Commit

Permalink
fix: update default maxPieceLength to be 4 MiB, rather than Infinity.
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentBot1 committed Jan 4, 2025
1 parent 2bed028 commit 18f6684
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Or, an **array of `string`, `File`, `Buffer`, or `stream.Readable` objects**.
filterJunkFiles: Boolean, // remove hidden and other junk files? (default = true)
private: Boolean, // is this a private .torrent? (default = false)
pieceLength: Number, // force a custom piece length (number of bytes)
maxPieceLength: Number, // force a maximum piece length for auto piece length selection, does not affect pieceLength option (default = Infinity)
maxPieceLength: Number, // force a maximum piece length for auto piece length selection, does not affect pieceLength option (default = 4 MiB)
announceList: [[String]], // custom trackers (array of arrays of strings) (see [bep12](http://www.bittorrent.org/beps/bep_0012.html))
urlList: [String], // web seed urls (see [bep19](http://www.bittorrent.org/beps/bep_0019.html))
info: Object, // add non-standard info dict entries, e.g. info.source, a convention for cross-seeding
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function _parseInput (input, opts, cb) {
}

if (!opts.maxPieceLength) {
opts.maxPieceLength = Infinity
opts.maxPieceLength = 4 * 1024 * 1024
}

const numPaths = input.reduce((sum, item) => sum + Number(typeof item === 'string'), 0)
Expand Down

0 comments on commit 18f6684

Please sign in to comment.