Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keith/md5digest
An Objective-C NSString category for MD5 hex digests
https://github.com/keith/md5digest
Last synced: 16 days ago
JSON representation
An Objective-C NSString category for MD5 hex digests
- Host: GitHub
- URL: https://github.com/keith/md5digest
- Owner: keith
- License: mit
- Created: 2013-03-25T20:39:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T06:29:25.000Z (almost 9 years ago)
- Last Synced: 2024-03-14T20:53:23.441Z (8 months ago)
- Language: Objective-C
- Size: 14.6 KB
- Stars: 33
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## MD5Digest
This is an extremely simple `NSString` category that creates an MD5 digest from a given `NSString`. The logic to do this came straight from [these](http://stackoverflow.com/questions/652300/using-md5-hash-on-a-string-in-cocoa) [StackOverflow](http://stackoverflow.com/questions/2018550/how-do-i-create-an-md5-hash-of-a-string-in-cocoa) [questions](http://stackoverflow.com/questions/1524604/md5-algorithm-in-objective-c) so you can easily implement it on your own if you would like.
## Usage
It's quite simple:
```
NSString *digest = [someString MD5Digest];
```## Installation
Using CocoaPods:
```
pod 'MD5Digest'
```Otherwise just include `NSString+MD5.{h,m}` in your project.
### Testing
I wrote a quick Ruby script to test that the digest produced by this class extension matched that produced by Ruby's built in methods (not that they couldn't mess up, it's just much less likely). Run it with `ruby test.rb`. If you change the name in the project to something else, in order to test it you'll have to change it in the Ruby script as well.