Padding.buckets constructor

Padding.buckets({
  1. required int floor,
  2. required int step,
})

Pads to the smallest size that fits the signed envelope.

Sizes start at floor bytes, and each next size is the previous one plus 1/step of it, rounded up. Both parameters must be from 1 to 2^32 - 1, so they fit Rust's usize on every target, or this throws an ArgumentError.

Implementation

factory Padding.buckets({required int floor, required int step}) {
  _checkPaddingRange(floor, 'floor');
  _checkPaddingRange(step, 'step');
  return _BucketPadding(floor, step);
}