Tuesday, March 14, 2017

How to convert a string into sha256 in iOS

To convert a string into sha256 use the following code.

[str SHA256DigestString];

The O/P would be something like 3026d32a577df45d512fb409e17be0acc56baa02d9447a8eea4c542719e2a2ce

How to get the UUID in iOS


To get the UUID in iOS use the following code:

NSString *UUID = [[NSUUID UUID] UUIDString]; 
NSLog(@"UUID is : %@", UUID); 

The format should be something like 9063E103-1F1C-4220-818B-CB9FC94536D5