I want to generate a unique id for my chat application. (Chat between flutter app and angular web)
This is my dart code...
String peerId = widget.peerid; //some string value as ID
String currentUserId = widget.currentId; //some string value as ID
if (currentUserId.hashCode <= peerId.hashCode) {
ChatId = '$currentUserId-$peerId';
} else {
ChatId = '$peerId-$currentUserId';
}
print(ChatId);
From this I am generating a chatid. I want to do the same for my web app end chat room. How can I generate the similar chatId as I generated in dart?