Skip to content

Commit

Permalink
Release 0.1.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiChenghan committed Jul 4, 2016
1 parent 5bfdd1c commit 4d67cf8
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 390 deletions.
2 changes: 1 addition & 1 deletion Addition.podspec
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Addition"
s.version = "0.1.3"
s.version = "0.1.4"
s.summary = "ios扩展类集"

# This description is used to generate tags and improve search results.
Expand Down
26 changes: 7 additions & 19 deletions Addition/NSData+Addition.m
Expand Up @@ -18,27 +18,15 @@ @implementation NSData (Addition)
*/
-(NSString *)md5
{
CC_MD5_CTX md5;

CC_MD5_Init(&md5);

BOOL done = NO;
while(!done)
const char* original_str = (const char *)[self bytes];
unsigned char digist[CC_MD5_DIGEST_LENGTH];
CC_MD5(original_str, (CC_LONG)strlen(original_str), digist);
NSMutableString* outPutStr = [NSMutableString stringWithCapacity:10];
for(int i =0; i<CC_MD5_DIGEST_LENGTH;i++)
{
CC_MD5_Update(&md5, [self bytes], (unsigned int)[self length]);
if( [self length] == 0 ) done = YES;
[outPutStr appendFormat:@"%02x",digist[i]];
}
unsigned char digest[CC_MD5_DIGEST_LENGTH];
CC_MD5_Final(digest, &md5);
return [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
digest[0], digest[1],
digest[2], digest[3],
digest[4], digest[5],
digest[6], digest[7],
digest[8], digest[9],
digest[10], digest[11],
digest[12], digest[13],
digest[14], digest[15]];
return [outPutStr lowercaseString];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Addition/NSString+Addition.m
Expand Up @@ -142,8 +142,8 @@ -(CGSize)getStringSize:(UIFont *)font size:(CGSize)size
+(NSString *)md5:(NSString *)md5String
{
const char *cStr = [md5String UTF8String];
unsigned char result[16];
CC_MD5(cStr, (int)strlen(cStr), result); // This is the md5 call
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5(cStr, (CC_LONG)strlen(cStr), result);
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
@@ -1,5 +1,5 @@
PODS:
- Addition (0.1.3)
- Addition (0.1.4)
- Expecta (1.0.5)
- Expecta+Snapshots (2.0.0):
- Expecta (~> 1.0)
Expand All @@ -23,7 +23,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Addition: 8880928d197efa44f4994210276e6f43c4b12380
Addition: 104c5242795cea8230287dfafa826cc9a1eea095
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
Expand Down
7 changes: 2 additions & 5 deletions Example/Pods/Local Podspecs/Addition.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

553 changes: 220 additions & 333 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/Addition/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ Addition is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'Addition', '~>0.1.3'
pod 'Addition', '~>0.1.4'
```

## Author
Expand All @@ -30,6 +30,7 @@ Addition is available under the MIT license. See the LICENSE file for more info.


## 更新说明
- 0.1.4修复NSDate的md5方法,原方法md5失败。
- 0.1.3新增NSDate取时间间隔+(void)getSepTimeWithDay...方法。
- 0.1.2新增NSString的encode和decode方法。
- 0.1.1新增NSDate扩展,方便时间获取。
Expand Down

0 comments on commit 4d67cf8

Please sign in to comment.