Google CRC32. It's still quite likely to get collisions, though. If you want to have a little more certainty that there won't be any collisions, Google MD5 or SHA-1.
Here is the all routine, but it seems have a bug...
In this routine there is a unique subcode for the same string.
Any improovment?
To use an md5 etc.. is an all story...
Difficault for me.
1 2 3 4 5 6 7 8 9 10 11 12 13
unsignedlongint UniqueCode(wchar_t* ch, int sbCode)
{
long power=2^(sizeof(wchar_t)*8);
longint code=0;
int res,j=0;
for (;*ch;ch++) {
res=*ch;
res+=power/2;
code+=res*pow(power+0.0,j++);
}
code+=sbCode*2^j;
return code;
}
It is a very complicate project, and i think i am finish, and without this function. It is about control in Greek anssient text, that means utf8. I convert the hole project to c++, without knowing STL, and reading and asq.
Thanks all for the great help.