home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / sbbs_src.exe / SBBS / SMB / CRC32.C < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-13  |  386 b   |  24 lines

  1. /* CRC32.C */
  2.  
  3. /* Developed 1990-1997 by Rob Swindell; PO Box 501, Yorba Linda, CA 92885 */
  4.  
  5. /* 32-bit CRC of a buffer */
  6.  
  7. #include "smblib.h"
  8. #include "crc32.h"
  9.  
  10. #ifdef __NT__
  11. #    define CRCCALL _pascal
  12. #else
  13. #    define CRCCALL
  14. #endif
  15.  
  16. ulong CRCCALL crc32(char *buf, ulong len)
  17. {
  18.     ulong l,crc=0xffffffff;
  19.  
  20. for(l=0;l<len;l++)
  21.     crc=ucrc32(buf[l],crc);
  22. return(~crc);
  23. }
  24.