diff options
author | Marvin W <git@larma.de> | 2017-03-10 16:02:32 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-10 16:09:47 +0100 |
commit | 7a1aa8c806a63cfd031c082524501e26d4a181ee (patch) | |
tree | 9d7895ce184d87e329d3ad62d8cda1d10c2596d2 /vala-xmpp/src/module/util.vala | |
parent | 5fc0435cc1227bf445d06a3931343020faaecd10 (diff) | |
download | dino-7a1aa8c806a63cfd031c082524501e26d4a181ee.tar.gz dino-7a1aa8c806a63cfd031c082524501e26d4a181ee.zip |
Do not expose UUID lib dependency outside vala-xmpp library
Diffstat (limited to 'vala-xmpp/src/module/util.vala')
-rw-r--r-- | vala-xmpp/src/module/util.vala | 8 |
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 |