I am looking to create a unique identifier for my chat application. (Chat between my Flutter app and Angular web)
Below is the code snippet written in Dart...
String peerId = widget.peerid; //string ID value
String currentUserId = widget.currentId; //string ID value
if (currentUserId.hashCode <= peerId.hashCode) {
ChatId = '$currentUserId-$peerId';
} else {
ChatId = '$peerId-$currentUserId';
}
print(ChatId);
I have successfully generated a chatID using this code. Now, I want to achieve the same functionality for the chat room on my web app. How can I generate a similar chatID like the one created in Dart?