mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-12 11:12:19 -04:00
message integrity
This commit is contained in:
parent
490051a650
commit
fd63a0d5e0
11 changed files with 370 additions and 237 deletions
|
@ -16,13 +16,15 @@ Map<String, dynamic> reconciledMessageToJson(proto.ReconciledMessage m) =>
|
|||
m.writeToJsonMap();
|
||||
|
||||
extension MessageExt on proto.Message {
|
||||
Uint8List get uniqueIdBytes {
|
||||
Uint8List get idBytes => Uint8List.fromList(id);
|
||||
|
||||
Uint8List get authorUniqueIdBytes {
|
||||
final author = this.author.toVeilid().decode();
|
||||
final id = this.id;
|
||||
return Uint8List.fromList([...author, ...id]);
|
||||
}
|
||||
|
||||
String get uniqueIdString => base64UrlNoPadEncode(uniqueIdBytes);
|
||||
String get authorUniqueIdString => base64UrlNoPadEncode(authorUniqueIdBytes);
|
||||
|
||||
static int compareTimestamp(proto.Message a, proto.Message b) =>
|
||||
a.timestamp.compareTo(b.timestamp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue