validate_piece_length

Function validate_piece_length 

Source
pub fn validate_piece_length(
    piece_length: u64,
    mode: PieceLengthMode,
) -> Result<u64>
Expand description

Validates a caller-selected piece length.

ยงErrors

Returns a metainfo error when the value is not a power of two or is outside the protocol-specific minimum and 16 MiB maximum.