[Kolab-devel] UID of vcard
Bo Thorsen
bo at sonofthor.dk
Thu May 22 09:32:52 CEST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 22 May 2003 09:22, Adriaan Putter wrote:
> Hi,
>
> How should the UID of a VCARD be generated?
QString KApplication::randomString(int length)
{
if (length <=0 ) return QString::null;
QString str;
while (--length)
{
int r=random() % 62;
r+=48;
if (r>57) r+=7;
if (r>90) r+=6;
str += char(r);
// so what if I work backwards?
}
return str;
}
KAddressbook calls this function with length 10. So it's just ten random
chars.
Bo.
- --
Bo Thorsen | Praestevejen 4
Senior Software Engineer | 5290 Marslev
Klarälvdalens Datakonsult | Denmark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+zH0xmT99lwfUS5IRAlxcAJ940u5mbKKHySmyXQJEj2KTxp+/rQCfU5ie
ev1Yt09JfxFz/VkQquaiwkc=
=/jSh
-----END PGP SIGNATURE-----
More information about the devel
mailing list