I’m trying to create unique file names by renaming them using their hashed value in iOS. How can I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you could achieve this by extending NSString,
Try this in your .h:
and this in your .m
you can implement this by making a new class called NSString+MD5, and inserting the code above in the corresponding files (.h and .m)
EDIT: Do not forget to import
EDIT 2:
And for NSData;
your .m:
Please note that the value returned is autorelease and might need to be retained by the receiver.
Hope this helps.