convert method

  1. @override
String convert(
  1. Segwit input
)
override

Converts input and returns the result of the conversion.

Implementation

@override
String convert(Segwit input) {
  var program = input.program;

  if (isTooShortProgram(program)) {
    throw InvalidProgramLength('too short');
  }

  if (isTooLongProgram(program)) {
    throw InvalidProgramLength('too long');
  }

  var data = _convertBits(program, 8, 5, true);

  return bech32.encode(Bech32m(input.hrp, data));
}