[jdev] Case sensitive & jid

Matthias Wimmer m at tthias.net
Fri May 7 10:37:08 CDT 2004


Hi Remy!

Remy HAREL schrieb am 2004-05-07 17:14:08:
>  I don't understand why I would have to use x-prep profiles, I make the 
> md5 sum of the jid_full(sess->jid) and it works fine. Yet, my problem is 
> to know if remy at gabber.gicm.net/Gabber and Remy at gabber.gicm.net/Gabber 
> are the same users or not. If they are, my md5 sum is perfect, but if 
> not, I would have to use your x-prep profile.

"remy at gabber.gicm.net/Gabber" is the same user as
"remy at gabber.gicm.net/Gabber".

In this case md5(lowercase(jid_full)) would work.

"remy at gabber.gicm.net/Gabber" and "remy at gabber.gicm.net/gabber" are two
different addresses. Therefore md5(lowercase(jid_full)) would result in
the same hash for two different addresses!

"müller at gabber.gicm.net/Gabber" and "MÜLLER at gabber.gicm.net/Gabber" are
the same users. But as normal impelemtations of lowercase() only convert
the letters A to Z but not 'accented' letters like "Ü",
md5(lowercase(jid_full)) would result in two different hashes for the
same address. Therefore you need a version of lowercase() that knows
about all the normalizations of all letters in unicode. This is exactly
what stringprep does. The profile in this case (a bit simplified) just
tells you which letters are allowed at all and which are forbidden.


Tot kijk
    Matthias
-- 
Fon: +49-(0)70 0770 07770       http://matthias.wimmer.name/
HAM: DB1MW                      xmpp:mawis at charente.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.jabber.org/jdev/attachments/20040507/0da0a10a/attachment-0002.pgp>


More information about the JDev mailing list