added guardian letters with chat and multiple answer functionalities

This commit is contained in:
2026-09-20 16:12:45 +02:00
parent 67c935c05b
commit 2423c1a75e
68 changed files with 8348 additions and 226 deletions
+9
View File
@@ -8,3 +8,12 @@ String randomHexId({int bytes = 16}) {
(_) => random.nextInt(256),
).map((b) => b.toRadixString(16).padLeft(2, '0')).join();
}
/// Random RFC 4122 version-4 UUID, for ids a server expects in UUID form.
String randomUuidV4() {
final hex = randomHexId();
final variant = (int.parse(hex[16], radix: 16) & 0x3 | 0x8).toRadixString(16);
return '${hex.substring(0, 8)}-${hex.substring(8, 12)}-'
'4${hex.substring(13, 16)}-$variant${hex.substring(17, 20)}-'
'${hex.substring(20)}';
}