Chromium Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
914 B

13 years ago
  1. //
  2. // MGMMD5.h
  3. //
  4. // Created by Mr. Gecko <GRMrGecko@gmail.com> on 1/6/10.
  5. // No Copyright Claimed. Public Domain.
  6. //
  7. #ifndef _MD_MD5
  8. #define _MD_MD5
  9. #ifdef __NEXT_RUNTIME__
  10. #import <Foundation/Foundation.h>
  11. extern NSString * const MDNMD5;
  12. @interface NSString (MGMMD5)
  13. - (NSString *)MD5;
  14. - (NSString *)pathMD5;
  15. @end
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. char *MD5String(const char *string, int length);
  21. char *MD5File(const char *path);
  22. #define MD5Length 16
  23. #define MD5BufferSize 4
  24. struct MD5Context {
  25. uint32_t buf[MD5BufferSize];
  26. uint32_t bits[2];
  27. unsigned char in[64];
  28. };
  29. void MD5Init(struct MD5Context *context);
  30. void MD5Update(struct MD5Context *context, const unsigned char *buf, unsigned len);
  31. void MD5Final(unsigned char digest[MD5Length], struct MD5Context *context);
  32. void MD5Transform(uint32_t buf[MD5BufferSize], const unsigned char inraw[64]);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif