code_junkie

CRC32 C or C++ implementation

Nov 12th, 2011
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. /* Copyright (C) 1986 Gary S. Brown. You may use this program, or
  2. code or tables extracted from it, as desired without restriction.*/
  3.  
  4. MHASH td = mhash_init(MHASH_CRC32);
  5.  
  6. if (td == MHASH_FAILED) return -1; // handle failure
  7.  
  8. mhash(td, s, strlen(s));
  9.  
  10. unsigned int digest = 0; // crc32 will be stored here
  11.  
  12. mhash_deinit(td, &digest);
  13.  
  14. // do endian swap here if desired
Add Comment
Please, Sign In to add comment