Category : Files from Magazines
Archive   : CUJ9301.ZIP
Filename : 1101068A
igchecksum (z, c)
register const char *z;
register int c;
{
register unsigned int ichk1, ichk2;
ichk1 = 0xffff;
ichk2 = 0;
do
{
register unsigned int b;
/* Rotate ichk1 left. */
if ((ichk1 & 0x8000) == 0)
ichk1 <<= 1;
else
{
ichk1 <<= 1;
++ichk1;
}
/* Add the next character to ichk1. */
b = *z++ & 0xff;
ichk1 += b;
/* Add ichk1 xor the character position in the buffer counting from
the back to ichk2. */
ichk2 += ichk1 ^ c;
/* If the character was zero, or adding it to ichk1 caused an
overflow, xor ichk2 to ichk1. */
if (b == 0 || (ichk1 & 0xffff) < b)
ichk1 ^= ichk2;
}
while (--c > 0);
return ichk1 & 0xffff;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/