Function filecoin_proofs::generate_piece_commitment [−][src]
pub fn generate_piece_commitment<T: Read>(
source: T,
piece_size: UnpaddedBytesAmount
) -> Result<PieceInfo>
Expand description
Generates a piece commitment for the provided byte source. Returns an error
if the byte source produced more than piece_size
bytes.
Arguments
source
- a readable source of unprocessed piece bytes. The piece’s commitment will be generated for the bytes read from the source plus any added padding.piece_size
- the number of unpadded user-bytes which can be read from source before EOF.