Adding a mechanism to work with NSData as well as NSString (since the original logic ultimately used NSData anyways). Reworked the iOS portions of the code in terms of it.