Re: How do I convert an NSString into a 16 bit int
Re: How do I convert an NSString into a 16 bit int
- Subject: Re: How do I convert an NSString into a 16 bit int
- From: "David Symonds" <email@hidden>
- Date: Sun, 25 Nov 2007 14:29:09 +1100
On Nov 25, 2007 2:22 PM, Michael Swan <email@hidden> wrote:
> Does anyone have any suggestions for how to convert an NSString into a
> 16 bit int? I have checked Google and can only find ways of creating
> an MD5 hash that is much , much longer. I am looking for something
> similar to an MD5 hash I just need it to be 16 bits not 128. I am also
> hoping that I don;t have to become an expert in cryptography to do this.
If you're not after something cryptographically secure, and you don't
care about speed, use the MD5 hash and just take the first 4 hex
digits (16 bits). Alternatively, grab some CRC-16 code from somewhere
and use that. It'll all depend on the purpose you are using the result
for.
Dave.
_______________________________________________
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