toToken method
The canonical text token: Crockford base32 of the 8 id bytes (the big-endian session followed by the big-endian index).
Implementation
String toToken() {
final b = Uint8List(8);
ByteData.view(b.buffer)
..setUint32(0, session, Endian.big)
..setUint32(4, index, Endian.big);
return encodeBase32(b);
}