[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MD5
From: |
David Ayers |
Subject: |
Re: MD5 |
Date: |
Thu, 23 Jan 2003 13:47:15 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 |
Richard Frith-Macdonald wrote:
I already added a simple category of NSData to the Additions library,
consisting only of an -MD5Digest method returning an NSData object.
Cool, I'll try to get a gsweb patch in soon...
I'm not sure what the other methods are supposed to do exactly ... the
string encoding makes sense where the string is the input to the
digest ... but what to do when producing string output? I don't think
there is any standard format for representing a digest as a string,
unless it's to encode the bytes as pairs of hex digits.
certainly, you can't just use [NSString-initWithData:encoding:] to
produce a string as you have no guarantee that the bytes of the digest
are valid characters in the encoding you specify.
Actually yes, I did fall into that trap here :-). What I actually meant
would probably be something like
@implementation NSData (MD5)
...
- (NSString *)md5String
{
return [[self md5Digest] hexadecimalStringRepresentation]
}
@end
and at that point the encoding wouldn't hav to be dealt with.
and maybe:
@implementation NSString (MD5)
- (NSString *)md5StringUsingEncoding: (NSStringEncoding) enc
{
return [[self dataUsingEncoding: enc] md5String];
}
- (NSString *)md5String
{
return [[self dataUsingEncoding: [isa defaultCStringEncoding] md5String];
}
- Re[2]: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, (continued)
- Re[2]: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, Manuel Guesdon, 2003/01/22
- Re: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, David Ayers, 2003/01/22
- Re[2]: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, Manuel Guesdon, 2003/01/22
- Re: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, David Ayers, 2003/01/22
- Re[2]: [GSWHackers] [PATCH/RFC] GSWeb - single GSW/WO namespace frameworks, Manuel Guesdon, 2003/01/22
- MD5, David Ayers, 2003/01/22
- Re: MD5, Pete French, 2003/01/23
- Re: MD5, David Ayers, 2003/01/23
- Re: MD5, Pete French, 2003/01/23
- Re: MD5, Richard Frith-Macdonald, 2003/01/23
- Re: MD5,
David Ayers <=
- Re[2]: MD5, Manuel Guesdon, 2003/01/24
- Re: MD5, David Ayers, 2003/01/24
- Re: MD5, Richard Frith-Macdonald, 2003/01/24
- Re: MD5, David Ayers, 2003/01/24
- Re: MD5, David Ayers, 2003/01/24
- Re[2]: MD5, Manuel Guesdon, 2003/01/25