calculate_padding¶
-
asdf.util.
calculate_padding
(content_size, pad_blocks, block_size)[source]¶ Calculates the amount of extra space to add to a block given the user’s request for the amount of extra space. Care is given so that the total of size of the block with padding is evenly divisible by block size.
Parameters: content_size : int
The size of the actual content
pad_blocks : float or bool
block_size : int
The filesystem block size to use.
Returns: nbytes : int
The number of extra bytes to add for padding.