Re: md5 hashing on GNUstep

2020-04-01 Thread Johannes Brakensiek
On 1 Apr 2020, at 20:36, Andreas Fink wrote: Your approach might not give you the intended result if you have NSStrings containing Unicode characters which contains zero bytes. Your strlen() call would stop at that character and not go to the full length of a NSString. So a conversion to

Re: md5 hashing on GNUstep

2020-04-01 Thread Andreas Fink
Your approach might not give you the intended result if you have NSStrings containing Unicode characters which contains zero bytes. Your strlen() call would stop at that character and not go to the full length of a NSString. So a conversion to NSData and use its length would be better. For

Re: md5 hashing on GNUstep

2020-04-01 Thread Andreas Höschler
Hi Fred, > Have a look at libs-base/Source/Additions/NSData+GNUstepBase.m Thanks!! That file is a treasure chest ... Best wishes, Andreas

Re: md5 hashing on GNUstep

2020-04-01 Thread Andreas Höschler
Hi Nikolaus, >> I have the following NSString category >> >> @implementation NSString (NSStringJsonExtension) >> >> - (NSString *)md5 >>{ >> #ifdef __APPLE__ >> const char *cStr = [self UTF8String]; >> unsigned char result[CC_MD5_DIGEST_LENGTH]; >> CC_MD5( cStr,

Re: md5 hashing on GNUstep

2020-04-01 Thread Fred Kiefer
_MD5_DIGEST_LENGTH]; >> ^ >> SRHTTPRequest.m:93:27: note: each undeclared identifier is reported only >> once for each function it appears in >> SRHTTPRequest.m:94:6: warning: implicit declaration of function 'CC_MD5' >> [-Wimplicit-function-declaration] >> CC_MD5( cStr, (int)strlen(cStr), result ); // This is the md5 call >> ^ >> Any idea how to do md5 hashing on Linux/GNUstep? >> >> Thanks a lot in advance! >> >> Andreas

Re: md5 hashing on GNUstep

2020-04-01 Thread Niels Grewe
On 01.04.20 19:46, H. Nikolaus Schaller wrote: > >> Am 01.04.2020 um 19:43 schrieb Andreas Höschler : >> >> Hi all, >> >> I have the following NSString category >> >> @implementation NSString (NSStringJsonExtension) >> >> - (NSString *)md5 >> { >> #ifdef __APPLE__ >> const

Re: md5 hashing on GNUstep

2020-04-01 Thread H. Nikolaus Schaller
LENGTH]; >^ > SRHTTPRequest.m:93:27: note: each undeclared identifier is reported only once > for each function it appears in > SRHTTPRequest.m:94:6: warning: implicit declaration of function 'CC_MD5' > [-Wimplicit-function-declaration] > CC_MD5(

md5 hashing on GNUstep

2020-04-01 Thread Andreas Höschler
ier is reported only once for each function it appears in SRHTTPRequest.m:94:6: warning: implicit declaration of function 'CC_MD5' [-Wimplicit-function-declaration] CC_MD5( cStr, (int)strlen(cStr), result ); // This is the md5 call ^ Any idea how to do md5 hashing on Linux/GNUstep? Tha