refactor: popular [wip]

mod: grpc request
This commit is contained in:
bggRGjQaUbCoE
2024-10-10 16:33:20 +08:00
parent 2ccfd788e6
commit 6f86fe75ae
32 changed files with 8661 additions and 157 deletions

View File

@@ -25,6 +25,14 @@ import '../models/github/latest.dart';
class Utils {
static final Random random = Random();
static String generateRandomString(int length) {
const characters = '0123456789abcdefghijklmnopqrstuvwxyz';
Random random = Random();
return String.fromCharCodes(Iterable.generate(length,
(_) => characters.codeUnitAt(random.nextInt(characters.length))));
}
static String genAuroraEid(int uid) {
if (uid == 0) {
return ''; // Return null for a UID of 0