secureRandomToken function
Generates a cryptographically secure random token.
Implementation
String secureRandomToken({int length = 32}) {
final rand = Random.secure();
final bytes = List<int>.generate(length, (_) => rand.nextInt(256));
return base64UrlEncode(bytes);
}