MGMMD/Classes/MD/MGMMD5.h

51 lines
976 B
C
Raw Normal View History

2010-08-23 19:10:28 -05:00
//
// MGMMD5.h
//
// Created by Mr. Gecko <GRMrGecko@gmail.com> on 1/6/10.
// No Copyright Claimed. Public Domain.
//
#ifndef _MD_MD5
#define _MD_MD5
#ifdef __NEXT_RUNTIME__
#import <Foundation/Foundation.h>
extern NSString * const MDNMD5;
@interface NSString (MGMMD5)
- (NSString *)MD5;
- (NSString *)pathMD5;
@end
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern const struct MGMHashDescription MD5Desc;
2010-08-23 19:10:28 -05:00
char *MD5String(const char *string, int length);
char *MD5File(const char *path);
#define MD5Length 16
#define MD5BufferSize 64
2010-08-23 19:10:28 -05:00
struct MD5Context {
uint32_t length;
uint32_t state[4], curlen;
unsigned char buf[MD5BufferSize];
2010-08-23 19:10:28 -05:00
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, const unsigned char *buf, unsigned len);
void MD5Final(unsigned char digest[MD5Length], struct MD5Context *context);
void MD5Transform(struct MD5Context *context, unsigned char *buf);
int MD5Test();
2010-08-23 19:10:28 -05:00
#ifdef __cplusplus
}
#endif
#endif