mirror of
https://github.com/ente-io/ente.git
synced 2025-07-01 13:13:35 +00:00
18 lines
512 B
Dart
18 lines
512 B
Dart
import 'package:nanoid/nanoid.dart';
|
|
|
|
const enteWhiteListedAlphabet =
|
|
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
const clusterIDLength = 22;
|
|
|
|
String newClusterID() {
|
|
return "cluster_${customAlphabet(enteWhiteListedAlphabet, clusterIDLength)}";
|
|
}
|
|
|
|
String newID(String prefix) {
|
|
return "${prefix}_${customAlphabet(enteWhiteListedAlphabet, clusterIDLength)}";
|
|
}
|
|
|
|
String newIsolateTaskID(String task) {
|
|
return "${task}_${customAlphabet(enteWhiteListedAlphabet, clusterIDLength)}";
|
|
}
|