toCanonical method

String toCanonical()

Render the canonical, 26-character format.

Implementation

String toCanonical() {
  final result = Uint8List(26);
  _encode(0, 5, result, 0, 9); // time
  _encode(6, 10, result, 10, 17); // random upper 40-bit
  _encode(11, 15, result, 18, 25); // random lower 40-bit
  final sb = StringBuffer();
  for (var i = 0; i < 26; i++) {
    sb.write(_base32[result[i]]);
  }
  return sb.toString();
}