Re: SHA1 hash depends on calendar system in use? [SOLVED]
Re: SHA1 hash depends on calendar system in use? [SOLVED]
- Subject: Re: SHA1 hash depends on calendar system in use? [SOLVED]
- From: Graham Cox <email@hidden>
- Date: Sun, 15 Feb 2009 23:35:23 +1100
On 15 Feb 2009, at 11:06 pm, Graham Cox wrote:
I have some code using the openssl library to perform some public-
key decryption. I'm finding that the calendar system in use
(Gregorian vs. Hebrew say, as set in System Preferences) affects the
outcome of performing a SHA1 hash on some arbitrary data. Is this to
be expected? It seems weird to me - it makes it difficult to compare
hashes on machines not set to the same calendar system that the hash
was created on.
OK, never mind...
Unless you use Aquatic Prime. The way AQP computes the hash of a given
dictionary is to concatenate the dictionary object's -description
strings, then hash that. If the dictionary contains a NSDate object,
the description will be sensitive to the calendar system set in System
Prefs, hence the hash will come out differently. I'm not using AQP but
I did borrow its hashing method. I've now changed it, and the problem
is solved for me.
But if you are using AQP, this is another one of its many flaws.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden