decimalToBase36 function

String decimalToBase36(
  1. BigInt decimalValue
)

Implementation

String decimalToBase36(BigInt decimalValue) {
  final base36Characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  final base36List = <String>[];

  while (decimalValue > BigInt.zero) {
    base36List.insert(
        0, base36Characters[(decimalValue % BigInt.from(36)).toInt()]);
    decimalValue ~/= BigInt.from(36);
  }

  return base36List.join('');
}