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
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
Hi Fred,
> Have a look at libs-base/Source/Additions/NSData+GNUstepBase.m
Thanks!! That file is a treasure chest ...
Best wishes,
Andreas
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,
_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
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
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(
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