aboutsummaryrefslogtreecommitdiff
path: root/vala-xmpp/src/module/util.vala
diff options
context:
space:
mode:
Diffstat (limited to 'vala-xmpp/src/module/util.vala')
-rw-r--r--vala-xmpp/src/module/util.vala8
1 files changed, 8 insertions, 0 deletions
diff --git a/vala-xmpp/src/module/util.vala b/vala-xmpp/src/module/util.vala
index 4d762883..65a9b261 100644
--- a/vala-xmpp/src/module/util.vala
+++ b/vala-xmpp/src/module/util.vala
@@ -10,4 +10,12 @@ namespace Xmpp {
string? get_resource_part(string jid) {
return jid.split("/")[1];
}
+
+ public string random_uuid() {
+ uint8[] rand = new uint8[16];
+ char[] str = new char[37];
+ UUID.generate_random(rand);
+ UUID.unparse_upper(rand, str);
+ return (string) str;
+ }
} \ No newline at end of file