[Standards-JIG] Unique room names for JEP-45
Robert B Quattlebaum, Jr.
darco at deepdarc.com
Fri Jun 16 20:25:32 UTC 2006
On Jun 16, 2006, at 11:44 AM, Remko Troncon wrote:
> JEP-0045 (Multi-User Chat) describes the possibility of creating
> one-to-one chats into multi-user-chats, a feature present in most
> of today's IM protocols. However, to be able to do this, you need
> to be able to find a unique room name to create a new room, which
> is pretty complex to construct from the client. You can generate a
> hash of some kind, which has a high chance of indeed being unique.
> However, for correctness, you still have to account for it not
> being unique, which boils down to a trial and error protocol.
Not necessarily. If you used some sort of GUID, then you can avoid a
trail and error mechanism---as a collision would be so unlikely it
would be effectively impossible. When you have such a situation, you
can avoid doing trial and error without worrying about correctness
For example, take the following information:
* JID of all people involved with conference
* pre-existing chat history
* Current machine time (plus microseconds)
* IP Address
* value of global stanza count
If you take all of that info, concatenate it, and take the MD5 hash
of it, you can rest assured that it will be unique, and you won't
have to do any trial and error. In fact, I think it's a bit of overkill.
You could easily use some sort of cryptographically secure random
number generator instead, which would be even better.
In other words, when there is a 1 out of 2^128 chance that there will
be a collision, I don't think that it is "correct" to check for
collisions. It is redundant.
Jabber: darco at deepdarc.com
eMail: darco at deepdarc.com
More information about the Standards