digestLength static method

void digestLength(
  1. int digestLength, {
  2. int? max,
  3. int? min,
  4. required String operation,
  5. required String name,
})

Requires digestLength to be non-negative and within min/max, throws BuError otherwise.

Implementation

static void digestLength(
  int digestLength, {
  int? max,
  int? min,
  required String operation,
  required String name,
}) {
  if ((max != null && digestLength > max) ||
      (min != null && digestLength < min) ||
      digestLength.isNegative) {
    throw CoreErrors.invalidOperationArguments(
      operation,
      name: name,
      reason: 'Invalid digest length.',
    );
  }
  // if (!allowed.contains(data.length)) {

  // }
}