added ios hashing code