© 2013 All rights reserved.

Objective-C: Creating sha1 byte array

I solved an interesting problem that I needed to create a SHA1 hash, but the result had to be a byte array.

I needed to do in Objective-C function that will return the same result as the following C# code:


The main problem is in selecting the correct encoding, and convert input string. Here is final function:

Comments are closed for this page

Hi, i am programmer from the Czech Republic. I love web development (Ruby, Ruby on Rails, PHP, Nette) and iOS development (Objective-C, Cocoa).
To cooperate, here is my phone:
+420 608 836