base36ToDecimal function

BigInt base36ToDecimal(
  1. String base36Number
)

Implementation

BigInt base36ToDecimal(String base36Number) {
  final base36Characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  BigInt decimalValue = BigInt.zero;

  for (int i = 0; i < base36Number.length; i++) {
    int digitValue = base36Characters.indexOf(base36Number[i]);
    decimalValue = decimalValue * BigInt.from(36) + BigInt.from(digitValue);
  }

  return decimalValue;
}