Function filecoin_proofs::pieces::get_piece_alignment

source ยท
pub fn get_piece_alignment(
    written_bytes: UnpaddedBytesAmount,
    piece_bytes: UnpaddedBytesAmount,
) -> PieceAlignment
Expand description

Given a number of bytes already written to a staged sector (ignoring bit padding) and a number of bytes (before bit padding) to be added, return the alignment required to create a piece where len(piece) == len(sector size)/(2^n) and sufficient left padding to ensure simple merkle proof construction.