|
发表于 2011-4-7 17:07:10
|
显示全部楼层
WORD CalcFileNameHash (LPCWSTR filename)
(
WORD chk = 0;
int len, i;
len = lstrlenW (filename);
for (i = 0; i <len; i + +) (
WCHAR c = (WCHAR) CharUpperW ((LPWSTR) filename );
chk = (WORD) (((chk <<15) | (chk>> 1)) + LOBYTE (c));
chk = (WORD) (((chk <<15) | (chk>> 1)) + HIBYTE (c));
)
return chk;
) |
|